AGENT SKILL

browser-control

Configure and troubleshoot Browser Use Browser, BrowserSession, BrowserProfile, CDP, real Chrome profiles, cloud browsers, domains, proxies, downloads, screenshots, DOM, and low-level Actor control.

License 许可
MIT
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
browser-control
license
MIT
metadata
{ "disco-role": "operating" }
description
Configure and troubleshoot Browser Use Browser, BrowserSession, BrowserProfile, CDP, real Chrome profiles, cloud browsers, domains, proxies, downloads, screenshots, DOM, and low-level Actor control.
disable-model-invocation
true

02 资源文件 4

03 SKILL.md 正文

Browser Control

Use this sub-skill when a Browser Use task depends on configuring, starting, connecting to, or directly controlling browser sessions rather than only writing an Agent workflow.

Own This Scope

  • Browser / BrowserSession lifecycle: local Chromium, existing Chrome, CDP URLs, cloud browser sessions, tabs, cookies, storage state, screenshots, downloads, recordings, and teardown.
  • BrowserProfile configuration: launch/connect parameters, profiles, domains, proxies, viewport/window, extensions, iframe/DOM capture, timing, video/HAR/trace paths, and security flags.
  • Direct browser control: Actor Page, Element, and Mouse; CDP-backed methods on BrowserSession; DOM selector maps; screenshots and page state summaries.
  • Browser safety: allowed_domains, prohibited_domains, block_ip_addresses, download path containment, file/profile isolation, and risky options such as disable_security.

Route Elsewhere

  • Agent construction, prompts, Agent.run(), callbacks, history, initial actions, flash/planning settings: ../agent-programming/SKILL.md.
  • Custom tools, ActionResult, file tools, Playwright-backed actions, parameter injection, sensitive data tools: ../tools-and-actions/SKILL.md.
  • LLM provider selection, ChatBrowserUse, structured output, cost, fallback models: ../llm-and-output/SKILL.md.
  • Terminal browser-use / bu sessions and CLI profile commands: ../cli-and-sessions/SKILL.md.
  • @sandbox, MCP, profile sync, monitoring, and production integration architecture: ../production-integrations/SKILL.md.

Quick API Imports

Prefer public imports for user code:

from browser_use import Browser, BrowserProfile
from browser_use.browser import BrowserSession, ProxySettings

Facts to preserve:

  • Browser is the public alias for BrowserSession; use Browser(...) in simple examples and BrowserSession(...) when emphasizing the class name.
  • BrowserSession accepts most BrowserProfile fields directly, or can receive browser_profile=BrowserProfile(...) for reusable configuration.
  • Browser Use APIs are async for session/page operations; wrap examples with asyncio.run(main()) or call them from an existing event loop.
  • For browser automation models, recommend ChatBrowserUse in sibling examples, but keep model/provider details in ../llm-and-output/SKILL.md.

Default Decision Tree

  1. Need an Agent to browse with custom browser settings? Create browser = Browser(...) and pass Agent(..., browser=browser); route Agent parameters to ../agent-programming/SKILL.md.
  2. Need a local browser window? Use Browser(headless=False, window_size={...}); set keep_alive=True only when the user wants the browser left open.
  3. Need logged-in local Chrome? Prefer Browser.from_system_chrome(profile_directory=...) after closing Chrome; if the profile is locked, connect to a running Chrome via cdp_url instead.
  4. Need an already-running browser? Launch Chrome with a remote debugging port, verify /json/version, then use Browser(cdp_url="http://localhost:9222", is_local=True) or a BrowserProfile with those fields.
  5. Need cloud browser performance or anti-bot help? Use Browser(use_cloud=True) with a BROWSER_USE_API_KEY; route deployment details to ../production-integrations/SKILL.md.
  6. Need deterministic low-level clicks, selectors, screenshots, or cookies without LLM planning? Start a Browser and use Actor/Page/session APIs from references/browser-api.md.
  7. Need navigation guardrails? Configure allowed_domains or prohibited_domains before starting the session; never rely on prompt wording alone for domain security.

Safe Defaults

Use these defaults unless the user asks otherwise:

browser = Browser(
    headless=True,
    user_data_dir=None,
    allowed_domains=["example.com"],
    downloads_path="./downloads",
)
  • Use user_data_dir=None for incognito-like isolation when persistent login is not needed.
  • Use separate user_data_dir values for parallel browsers; do not share one writable profile across concurrent sessions.
  • Use allowed_domains for high-risk tasks; root domains like example.com also allow www.example.com, while wildcard patterns like *.example.com allow the root plus subdomains.
  • Keep disable_security=False; only set it for controlled local testing and call out the risk.
  • Prefer Browser(use_cloud=True) when users ask how to improve browser performance in production; Browser Use Cloud is optimized for Browser Use and can be streamed remotely.

Core Recipes

  • Local/headful, real Chrome, CDP, cloud browser, proxy, cookies/storage, parallel sessions, and recordings: references/browser-recipes.md.
  • Parameter catalog, session lifecycle, tabs, cookies, screenshots, Actor Page/Element/Mouse, DOM/state methods, and CDP helpers: references/browser-api.md.
  • Domain filtering, download containment, DOM/iframe/highlight behavior, screenshots, and guardrails: references/security-and-dom.md.
  • Install/import, Chromium, CDP, profile locks, cloud/API key, proxy, downloads, screenshots/video/HAR, and validation errors: references/troubleshooting.md.

Minimal Local Browser Example

import asyncio
from browser_use import Agent, Browser, ChatBrowserUse

async def main():
    browser = Browser(headless=False, window_size={"width": 1200, "height": 800})
    agent = Agent(task="Open example.com and summarize the page", llm=ChatBrowserUse(), browser=browser)
    await agent.run()
    await browser.kill()

asyncio.run(main())

Direct Control Example

import asyncio
from browser_use import Browser

async def main():
    browser = Browser(headless=True, user_data_dir=None)
    await browser.start()
    page = await browser.new_page("https://example.com")
    print(await page.get_title())
    print(await browser.get_current_page_url())
    await browser.kill()

asyncio.run(main())

Validation Checklist

Before handing code back to a user:

  • Imports use current public names: Browser, BrowserSession, BrowserProfile, ProxySettings.
  • Browser/session options are on Browser(...) or BrowserProfile(...), not on Agent(...) unless the Agent parameter is specifically browser, browser_session, or browser_profile.
  • Async methods are awaited: start, new_page, get_pages, navigate_to, take_screenshot, export_storage_state, kill.
  • Any profile, download, HAR, video, trace, or storage-state path is user-controlled and not a hidden local path.
  • CDP examples include a readiness check against http://host:port/json/version.
  • Cloud examples state BROWSER_USE_API_KEY is required but never include a key.
  • Security examples use concrete domain lists and explain redirects/new tabs can be blocked after navigation too.

Common Failure Routing

  • ValidationError or extra_forbidden: wrong constructor field or typo; verify against references/browser-api.md.
  • Unable to copy Chrome profile ... locked: close Chrome or use CDP with the already-running browser; see references/troubleshooting.md.
  • Navigation blocked by security policy: inspect allowed_domains / prohibited_domains; see references/security-and-dom.md.
  • Chrome failed to start, missing executable, or no display: install Chromium through Browser Use tooling, set headless=True, or use Browser(use_cloud=True).
  • Screenshot/video/HAR path empty: ensure the browser was started, path directories are writable, and the feature is supported by the chosen local/cloud session.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-triton-opt

Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-solve

END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-skill

PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-pattern-fusion

Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-orchestrate

Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-feedback

Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).

★ 351