
Browser Cdp
Drives a Chrome browser over CDP to reuse existing login sessions for automation and token extraction.
- skills.sh installs
- 11.8K
- GitHub stars
- 8.8K
- last updated
- Aug 21, 2026
What it does
- Covers launching Chrome in debug mode, opening URLs, waiting for page load, evaluating JavaScript, taking snapshots, and extracting auth tokens
- Runs the
setup-cdp-chrome.jsscript with detect-only, reset, profile, and dry-run options, with exit codes for consent handling - Requires explicit user consent before ending running Chrome processes, with a dry-run step and a NEEDS_CONSENT exit code for non-interactive calls
- Built on the
agent-browserCLI and intended for tasks that need an already-logged-in browser session on macOS, Linux, or Windows
Install
$ npx -y skills add zenstory-ai/oh-story-claudecode --skill browser-cdp -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Browser CDP 操作工具
通过 CDP(Chrome DevTools Protocol)连接 Chrome,复用登录态并执行浏览器操作。
前置条件
- macOS / Linux / Windows(实验性),已安装并使用过 Google Chrome,来源 profile 已存在
- Node.js 20+
agent-browser已安装:npm install -g agent-browser
启动或重建时,若需结束 Chrome 进程,先按下方流程征得同意;未保存的标签页或草稿可能丢失。
启动流程(每次都按这个顺序)
下文 {SKILL_DIR} 指本 skill(browser-cdp)的目录。
第一步:探测当前状态(无副作用)
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=needs-setup且CHROME_INSTALLED=no→ 本机没找到 Chrome,告诉用户先安装并用它登录一次需要的网站,不要运行 setup。CDP_STATUS=ready且本次只需连接 → 直接使用agent-browser --cdp 9222 ...,不要运行 setup。- 明确请求
--reset/--profile→ 即使 ready 也走重建,按下方「需要结束 Chrome 时」处理。 CDP_STATUS=needs-setup且CHROME_RUNNING=no→ 安全启动:node {SKILL_DIR}/scripts/setup-cdp-chrome.js 9222 --yesCDP_STATUS=needs-setup且CHROME_RUNNING=yes→ 按下方「需要结束 Chrome 时」处理。
Details
- Repository
- github.com/zenstory-ai/oh-story-claudecode
- Category
- Browser Automation & Scraping
- First seen
- May 16, 2026
More from zenstory-ai/oh-story-claudecode
All 13Similar to Browser Cdp
More Browser Automation & Scraping
browser-usebrowser-use/browser-use99.9K installsDirect CDP browser control for automation, scraping, testing, and screenshots, with optional cloud browsers for agents.
cdpbrowser-use/browser-harness-js718 installsDrive Chrome through the DevTools Protocol with a persistent session via browser-harness-js.
chrome-automationzc277584121/marketing-skills4K installsBrowser automation skill that drives the user's live Chrome session through agent-browser, reusing open logged-in tabs.
chrome-cdp-live-browserreason-machines/trending-skills1.5K installsThis connects Claude directly to your running Chrome browser via CDP, not a fresh headless instance. That means it can interact with tabs where you're already l
browser-actbrowser-act/skills108.5K installsBrowser automation CLI that fetches rendered pages, fills forms, and manages isolated browser sessions for AI agents.