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
- 参考文档references/browser-api.md8.8 KB
- 参考文档references/browser-recipes.md7.1 KB
- 参考文档references/security-and-dom.md6.6 KB
- 参考文档references/troubleshooting.md7.2 KB
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/BrowserSessionlifecycle: local Chromium, existing Chrome, CDP URLs, cloud browser sessions, tabs, cookies, storage state, screenshots, downloads, recordings, and teardown.BrowserProfileconfiguration: 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, andMouse; CDP-backed methods onBrowserSession; 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 asdisable_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/busessions 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:
Browseris the public alias forBrowserSession; useBrowser(...)in simple examples andBrowserSession(...)when emphasizing the class name.BrowserSessionaccepts mostBrowserProfilefields directly, or can receivebrowser_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
ChatBrowserUsein sibling examples, but keep model/provider details in../llm-and-output/SKILL.md.
Default Decision Tree
- Need an Agent to browse with custom browser settings? Create
browser = Browser(...)and passAgent(..., browser=browser); route Agent parameters to../agent-programming/SKILL.md. - Need a local browser window? Use
Browser(headless=False, window_size={...}); setkeep_alive=Trueonly when the user wants the browser left open. - 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 viacdp_urlinstead. - Need an already-running browser? Launch Chrome with a remote debugging port, verify
/json/version, then useBrowser(cdp_url="http://localhost:9222", is_local=True)or aBrowserProfilewith those fields. - Need cloud browser performance or anti-bot help? Use
Browser(use_cloud=True)with aBROWSER_USE_API_KEY; route deployment details to../production-integrations/SKILL.md. - Need deterministic low-level clicks, selectors, screenshots, or cookies without LLM planning? Start a
Browserand use Actor/Page/session APIs fromreferences/browser-api.md. - Need navigation guardrails? Configure
allowed_domainsorprohibited_domainsbefore 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=Nonefor incognito-like isolation when persistent login is not needed. - Use separate
user_data_dirvalues for parallel browsers; do not share one writable profile across concurrent sessions. - Use
allowed_domainsfor high-risk tasks; root domains likeexample.comalso allowwww.example.com, while wildcard patterns like*.example.comallow 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(...)orBrowserProfile(...), not onAgent(...)unless theAgentparameter is specificallybrowser,browser_session, orbrowser_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_KEYis 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
ValidationErrororextra_forbidden: wrong constructor field or typo; verify againstreferences/browser-api.md.Unable to copy Chrome profile ... locked: close Chrome or use CDP with the already-running browser; seereferences/troubleshooting.md.Navigation blocked by security policy: inspectallowed_domains/prohibited_domains; seereferences/security-and-dom.md.Chrome failed to start, missing executable, or no display: install Chromium through Browser Use tooling, setheadless=True, or useBrowser(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
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.
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.
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.
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.
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.
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).