Skip to content

feat(cdp): 新增专用浏览器模式,支持主力浏览器/专用浏览器双模式与任意Chromium 浏览器选择#69

Open
hcsum wants to merge 5 commits intoeze-is:mainfrom
hcsum:pr
Open

feat(cdp): 新增专用浏览器模式,支持主力浏览器/专用浏览器双模式与任意Chromium 浏览器选择#69
hcsum wants to merge 5 commits intoeze-is:mainfrom
hcsum:pr

Conversation

@hcsum
Copy link
Copy Markdown

@hcsum hcsum commented Apr 24, 2026

本 PR 为 CDP 增加“专用浏览器”模式,并完善“主力浏览器 / 专用浏览器”双模式能力;同时支持在多种 Chromium 浏览器中按需选择。
主力浏览器:现有逻辑,复用登录态/插件/书签,方便日常调研
专用浏览器:使用独立浏览器profile,CDP链接不会触发浏览器调试确认弹窗,方便无人值守的agent使用场景
可以只使用其中一种模式,也可以两种都开通,告诉agent操作哪个浏览器。

主要改动:

  1. 双模式能力
  • 支持 主力浏览器 与 专用浏览器 两种运行模式
  • 检查与连接流程按模式读取对应 profile 与调试端口
  • 健康检查输出模式信息,便于准确识别当前运行环境
  1. 支持选择任意 Chromium 浏览器
  • 支持通过 browser-id 选择不同 Chromium 浏览器实例
  • 支持常见 Chromium 系浏览器(如 Chrome、Chrome Canary、Chromium、
    Brave、Edge、Arc)
  • 专用浏览器模式可绑定独立 profile,便于长期复用与隔离
  1. 模式切换与运行一致性
  • 模式不一致时可进行代理重启与连接对齐
  • 减少“连错实例/连错 profile”导致的不确定行为
  • 与现有 tab 管理机制协同,提升长时任务可维护性
  1. 文档与提示统一
  • 明确主力浏览器/专用浏览器适用场景与取舍
  • 补充专用浏览器启动与检查方式
  • 统一术语与操作提示,降低理解与沟通成本

hcsum added 5 commits April 24, 2026 13:14
…rding

- add dedicated/main browser mode handling in check-deps with explicit CLI options and compatibility alias for legacy primary mode

- add browser mode aware proxy behavior in cdp-proxy, including mode-specific health/shutdown flow and dedicated profile port discovery

- align README, SKILL, references, and user-facing script wording to use main browser/browser terminology instead of primary/Chrome-centric wording

- keep browser app identifiers (for example Google Chrome) where they are product names, while making runtime guidance browser-generic

Reason:

- dedicated mode should support autonomous agent runs with less user presence, and terminology needed to consistently reflect the two-mode model across code and docs.
- restrict browser mode parsing to main|dedicated in check-deps

- remove primary-to-main normalization in cdp-proxy runtime mode handling

Reason:

- keep mode naming strict and avoid carrying deprecated alias behavior in pr branch.
- update check-deps default flow to auto-detect mode availability before connecting

- prefer dedicated mode when both main and dedicated are available unless user explicitly requests main

- keep single-available path automatic and prompt only when neither mode is available

- update SKILL.md with mandatory mode-selection decision flow and explicit dedicated command usage

Reason:

- align runtime behavior with the intended autonomous workflow and reduce unnecessary user prompts while keeping user override explicit.
- clarify that default check runs first only when mode is not yet fixed

- require dedicated-parameter continuity only after user explicitly selects dedicated

- update CDP mode wording to selected browser instance instead of daily browser

- make login guidance explicit: dedicated requires one-time manual sign-in

Reason:

- remove contradictory instructions in SKILL.md and keep setup guidance consistent with current check-deps selection logic.
- update README and SKILL preflight guidance so agents either start immediately when a browser is available or guide the user through enabling exactly one mode before retrying

- remove fallback port scanning so main and dedicated detection rely on DevToolsActivePort instead of guessing open ports

- make check-deps emit structured JSON on stdout while keeping human-readable progress logs on stderr

- restore mode-aware proxy health and shutdown behavior required by the startup contract

Reason:

The previous setup flow was ambiguous for agents, and the dependency checker mixed human logs with machine-consumed output. Tightening the browser setup contract and returning structured results makes CDP startup deterministic and safer to automate.
@hcsum
Copy link
Copy Markdown
Author

hcsum commented Apr 24, 2026

我本地改了web-access跑了个Brave+专用profile给agent在用。跑几天了没啥毛病。本想提个最小改动PR,结果越改越多,跟我本地原版也有出入了。此PR仅供参考吧。我没测这一版。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant