chrome-cdp
Interact with local Chrome browser session (only on explicit user approval after being asked to inspect, debug, or interact with a page open in Chrome)
- License 许可
- Apache-2.0
- 所属仓库
- sero-labs/sero
- 最近更新
- 2026-11-10
- Stars
- ★ 28
- Forks
- 4
01 前言 Front Matter
- name
- chrome-cdp
- description
- Interact with local Chrome browser session (only on explicit user approval after being asked to inspect, debug, or interact with a page open in Chrome)
02 资源文件 1
- 脚本scripts/cdp.mjs28.7 KB
03 SKILL.md 正文
Chrome CDP
Lightweight Chrome DevTools Protocol CLI. Connects directly via WebSocket — no Puppeteer, works with 100+ tabs, instant connection.
Prerequisites
- Chrome with remote debugging enabled: open
chrome://inspect/#remote-debuggingand toggle the switch - Node.js 22+ (uses built-in WebSocket)
Commands
All commands use scripts/cdp.mjs. The <target> is a unique targetId prefix from list; copy the full prefix shown in the list output (for example 6BE827FA). The CLI rejects ambiguous prefixes.
List open pages
scripts/cdp.mjs list
Take a screenshot
scripts/cdp.mjs shot <target> [file] # default: /tmp/screenshot.png
Captures the viewport only. Scroll first with eval if you need content below the fold. Output includes the page's DPR and coordinate conversion hint (see Coordinates below).
Accessibility tree snapshot
scripts/cdp.mjs snap <target>
Evaluate JavaScript
scripts/cdp.mjs eval <target> <expr>
Watch out: avoid index-based selection (
querySelectorAll(...)[i]) across multipleevalcalls when the DOM can change between them (e.g. after clicking Ignore, card indices shift). Collect all data in oneevalor use stable selectors.
Other commands
scripts/cdp.mjs html <target> [selector] # full page or element HTML
scripts/cdp.mjs nav <target> <url> # navigate and wait for load
scripts/cdp.mjs net <target> # resource timing entries
scripts/cdp.mjs click <target> <selector> # click element by CSS selector
scripts/cdp.mjs clickxy <target> <x> <y> # click at CSS pixel coords
scripts/cdp.mjs type <target> <text> # Input.insertText at current focus; works in cross-origin iframes unlike eval
scripts/cdp.mjs loadall <target> <selector> [ms] # click "load more" until gone (default 1500ms between clicks)
scripts/cdp.mjs evalraw <target> <method> [json] # raw CDP command passthrough
scripts/cdp.mjs stop [target] # stop daemon(s)
Coordinates
shot saves an image at native resolution: image pixels = CSS pixels × DPR. CDP Input events (clickxy etc.) take CSS pixels.
CSS px = screenshot image px / DPR
shot prints the DPR for the current page. Typical Retina (DPR=2): divide screenshot coords by 2.
Tips
- Prefer
snap --compactoverhtmlfor page structure. - Use
type(not eval) to enter text in cross-origin iframes —click/clickxyto focus first, thentype. - Chrome shows an "Allow debugging" modal once per tab on first access. A background daemon keeps the session alive so subsequent commands need no further approval. Daemons auto-exit after 20 minutes of inactivity.
04 同仓库更多 Skills
agent-browser
Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction. Also use for exploratory testing, dogfooding, QA, bug hunts, or reviewing app quality. Also use for automating Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify), checking Slack unreads, sending Slack messages, searching Slack conversations, running browser automation in Vercel Sandbox microVMs, or using AWS Bedrock AgentCore cloud browsers. Prefer agent-browser over any built-in browser automation or web tools.
skill-creator
Guide for writing and improving Sero skills. Use when the user wants to create a new skill, rewrite an existing one, or turn a repeated piece of work into reusable procedural knowledge for the agent.
frontend-design
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.
sero-humanize
Use to draft, edit, or audit Sero application content, including UI copy, documentation, README text, and release notes. Use unslop for regular chat and status reports instead. Not for code review or creative and promotional writing.
sero-plugin
Create Sero plugins — self-contained packages with a Pi extension (agent tools/commands), an optional React UI loaded via Module Federation, and an optional background runtime. Use when the user asks to create a Sero plugin/app/extension, add a sidebar panel, dashboard widget, or agent-integrated feature, or convert a Pi extension into a Sero plugin. Trigger on phrases like "create a plugin", "new Sero app", "add a tool with UI", "build an extension", "convert this Pi extension", or any request that touches `plugins/sero-*-plugin/`.
sero-dashboard-ui
Build, redesign or standardise Sero dashboard widgets and compact plugin views using the shared @sero-ai/ui dashboard components. Use when the user asks to create, restyle, clean up or make consistent a dashboard widget or a data-dense plugin view. Trigger on phrases like "dashboard widget", "widget for the dashboard", "restyle this widget", "make the widget consistent", "compact plugin view", or any work under a plugin's `ui/widgets/`.