技能 编程开发 控制浏览器启动与可见性

控制浏览器启动与可见性

v20260730
browser-visible
用于控制浏览器的启动模式,通过设置`headed`参数来决定窗口是否可见,或通过指定`cdp_port`来开启本地调试端口。这对于需要进行可视化验证或集成外部调试工具的自动化测试和开发场景至关重要。
获取技能
187 次下载
概览
Deprecated: This reference supports the stable browser implementation.
hatch. Prefer the unified browser tool when experimental mode is enabled.

Browser Launch Modes

browser.start launch modes:

  • Default: Playwright-managed, no debugging port
  • cdp_port=N: managed CDP, opens a local debugging port so other local tools can attach (see the browser_cdp skill)
  • private_mode=true: same as the default, kept for backward compatibility

Parameter meanings:

  • headed: whether to display the browser window
  • private_mode: kept for backward compatibility; it no longer changes the launch mode

The two parameters are independent and can be freely combined.

Common Usage

Default launch:

{"action": "start"}

Open a visible window:

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

private_mode

Already the default behavior — do not set it. The parameter is kept only so that older calls keep working, and passing it together with cdp_port is rejected.

Notes

  • The default is Playwright-managed with no debugging port
  • The launch mode is entirely determined by the call parameters
  • Managed CDP requires Chrome / Chromium / Edge to be installed locally
  • 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
信息
分类 编程开发
名称 browser-visible
版本 v20260730
大小 2.07KB
更新时间 2026-07-31
语言