browser-cdp

Featured

Use this skill when you need to control a Chrome browser via CDP (Chrome DevTools Protocol) to reuse existing login sessions. Covers: launching Chrome in debug mode, opening URLs, waiting for page load, evaluating JavaScript, taking snapshots, and extracting auth tokens. Trigger phrases: browser automation, CDP, agent-browser, 浏览器操作, 操作浏览器, Chrome CDP, 复用登录态, extract token from browser.

AI & Automation 4,662 stars 714 forks Updated today MIT

Install

View on GitHub

Quality Score: 96/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Browser CDP 操作工具 通过 CDP 协议控制 Chrome,复用已有登录态,执行浏览器自动化操作。 ## 前置条件 - macOS / Linux / Windows(实验性),已安装 Google Chrome - Node.js 20+ - `agent-browser` 已安装:`npm install -g agent-browser` > ⚠️ **首次启动会 kill 用户的常规 Chrome。** 在启动前必须征求用户同意(见下方"启动流程"),否则用户可能丢失未保存的标签页/草稿。 --- ## 启动流程(skill-mode 强制步骤) **第一步:探测当前状态(无副作用)** ```bash node {SKILL_DIR}/scripts/setup-cdp-chrome.js 9222 --detect-only ``` 输出形如: ``` CDP_STATUS=ready # 已就绪,可直接复用 CDP_URL=http://127.0.0.1:9222/json/version BROWSER=Chrome/148.0.7778.168 ``` ���: ``` CDP_STATUS=needs-setup CHROME_RUNNING=yes # 用户有 Chrome 在跑,启动会杀掉 CHROME_PID_COUNT=3 ``` **第二步:根据探测结果分支** - `CDP_STATUS=ready` → 直接使用 `agent-browser --cdp 9222 ...`,**不要运行 setup**。 - `CDP_STATUS=needs-setup` 且 `CHROME_RUNNING=no` → 安全启动: ```bash node {SKILL_DIR}/scripts/setup-cdp-chrome.js 9222 --yes ``` - `CDP_STATUS=needs-setup` 且 `CHROME_RUNNING=yes` → **先用 AskUserQuestion 工具向用户确认**:告知会杀掉 N 个 Chrome 进程、可能丢失未保存工作;用户同意后再带 `--yes` 启动;用户拒绝则放弃这次自动化。 **为什么不能直接 `--yes`:** 脚本在非 TTY(即 skill 模式 / Bash 工具)下,如果检测到 Chrome 在跑而没有 `--yes`,会以退出码 3 报 `NEEDS_CONSENT: ...` 并中止,**不会**静默杀进程。这是有意的兜底——但 skill 流程仍应先问用户,而不是看到 3 就盲传 `--yes`。 --- ## 启动脚本选项 | 选项 | 说明 | |------|------| | `--detect-only` | 只探测,不修改任何状态(skill 用) | | `--yes` | 已征得同意,跳过交互提示 | | `--reset` | 启动前清空 `~/chrome-debug-profile`(登录失效时用) | | `--profile <name>` | 使用非 Default 的 Chrome profile(如 `"Profile 1"`) | | `--dry-run` | 打印将执行的步骤,不执行 | 退出码:`0` 成功 / `1` 通用错误 / `2`...

Details

Author
worldwonderer
Repository
worldwonderer/oh-story-claudecode
Created
3 months ago
Last Updated
today
Language
JavaScript
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Solid

chrome-automation

Connect to and control Google Chrome browser using agent-browser with CDP (Chrome DevTools Protocol). Use when the user wants to automate their existing Chrome browser, see browser actions in real-time, or needs to control the Chrome instance they're already using. Handles installation, setup, connecting via remote debugging, and all browser automation tasks with live visual feedback.

4,273 Updated today
anbeime
AI & Automation Solid

boss-zhipin

Boss直聘招聘者侧网页操作 + 策略驱动寻访引擎。两类触发:(A) 单点操作——搜索候选人/看推荐牛人、读简历、打招呼、搜索畅聊、回复消息、求简历、查招聘数据/账号权益/牛人管理漏斗(换电话/换微信/约面/删除职位=永久红线只导航;关闭/发布职位=agent 可代操作,发布须提交前回读锁死字段+不买曝光);(B) 给一段搜索策略(JD/目标公司职位/人选能力要求)让它自动找人筛人触达并反馈——此时按 playbook.md 跑寻访管线。通过 browser-act 接管已登录的真实 Chrome(chrome-direct)执行。触发后先读 operation-map.md(怎么点页面)+ playbook.md(策略怎么跑)。

4 Updated 1 weeks ago
HideinbushZY
AI & Automation Listed

web-browser

Allows to interact with web pages by performing actions such as clicking buttons, filling out forms, and navigating links. It works by remote controlling Google Chrome or Chromium browsers using the Chrome DevTools Protocol (CDP). When Claude needs to browse the web, it can use this skill to do so.

3 Updated today
math2024444-spec