技能 编程开发 浏览器启动模式控制

浏览器启动模式控制

v20260423
browser-visible
用于精细控制浏览器启动的模式。用户可以决定是否显示浏览器窗口(`headed`),也可以选择切换底层的自动化管理引擎,从默认的 CDP 切换到 Playwright 模式(`private_mode`)。这对于需要特定环境或进行深度自动化测试的场景至关重要。
获取技能
486 次下载
概览

Browser Launch Modes

browser_use.start has only two launch modes:

  • Default: managed CDP
  • private_mode=true: Playwright-managed

Parameter meanings:

  • headed: whether to display the browser window
  • private_mode: whether to disable CDP and use Playwright instead

The two parameters are independent and can be freely combined.

Common Usage

Default launch:

{"action": "start"}

Open a visible window:

{"action": "start", "headed": true}

Without CDP:

{"action": "start", "private_mode": true}

Visible window + without CDP:

{"action": "start", "headed": true, "private_mode": true}

When to Use private_mode

Only set private_mode=true when the user explicitly requests one of the following:

  • Does not want the browser managed via CDP
  • Wants to use Playwright instead
  • Wants to reduce the possibility of other local tools connecting via CDP

Otherwise, just set headed=true as needed.

Notes

  • The default is managed CDP
  • The launch mode is entirely determined by the call parameters
  • Managed CDP requires Chrome / Chromium / Edge to be installed locally
  • private_mode=true does not mean absolutely undetectable — it simply switches to Playwright management
  • When the user manually operates the visible browser, the idle timer may not be refreshed
  • private_mode is an explicit parameter for each start call and is not persisted
  • If a browser is already running, you must stop it and then start again to switch launch modes or window visibility
  • Visible mode occupies the desktop and requires a graphical environment; it may not work on servers or headless environments
信息
Category 编程开发
Name browser-visible
版本 v20260423
大小 2.05KB
更新时间 2026-04-24
语言