feat(cdp): 默认优先连接 9333 常驻 Chrome

- 无显式连接参数时先尝试 CDP 9333,失败后回退本地浏览器启动

- 修复 CDP 页选择稳定性:过滤 omnibox 系统页、无可用页时自动创建 fallback 页

- 调整页面关闭后的 active 索引维护,降低 No page found 问题

- 新增 agent-browser-stealth 二进制入口并保持与 agent-browser 行为一致

- 同步更新 CLI 帮助、README、技能文档与 docs 说明
This commit is contained in:
leeguooooo
2026-02-24 16:22:49 +09:00
parent ea2e93dbba
commit 893ddfd259
11 changed files with 236 additions and 18 deletions
+3 -1
View File
@@ -6,6 +6,8 @@ export const metadata = pageMetadata("cdp-mode")
Connect to an existing browser via Chrome DevTools Protocol:
Default behavior in this fork: when `--cdp` is omitted, agent-browser first tries `localhost:9333` and falls back to local browser launch if CDP is unavailable.
```bash
# Start Chrome with: google-chrome --remote-debugging-port=9222
@@ -52,7 +54,7 @@ AGENT_BROWSER_AUTO_CONNECT=1 agent-browser snapshot
Auto-connect discovers Chrome by:
1. Reading Chrome's `DevToolsActivePort` file from the default user data directory
2. Falling back to probing common debugging ports (9222, 9229)
2. Falling back to probing common debugging ports (9222, 9229, 9333)
This is useful when:
+2
View File
@@ -6,6 +6,8 @@ export const metadata = pageMetadata("configuration")
Create an `agent-browser.json` file to set persistent defaults instead of repeating flags on every command.
In this fork, default launch behavior already prefers a resident Chrome at `localhost:9333` (CDP) and falls back to local Playwright launch when unavailable.
## Config File Locations
agent-browser checks two locations, merged in priority order: