Documentation
¶
Overview ¶
Package cdp provides shared code for Chrome DevTools Protocol automation and the command-line tools in this module.
The repository ships several related commands:
- cmd/cdp for general-purpose browser automation, inspection, and MCP use
- cmd/chrome-to-har for focused HAR and differential capture workflows
- cmd/churl for browser-backed fetching and extraction
- cmd/chdb for Chrome-oriented debugging workflows
- cmd/ndp for Node.js and V8 inspector workflows
- cmd/cdpscript and cmd/cdpscripttest for script execution and testing
Most consumers will use one of those commands directly. The root package exists only to document the module.
Internal packages provide most of the implementation:
- internal/browser manages browser discovery, launch, and interaction
- internal/recorder records HAR, streamed HARL, WebSocket, and WebRTC traffic
- internal/differential compares capture runs
- internal/browserprofile discovers and manages browser profiles
The broader entry point is cmd/cdp. The narrower capture-oriented entry point is cmd/chrome-to-har.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package cdpscript runs browser automation scripts over CDP.
|
Package cdpscript runs browser automation scripts over CDP. |
|
Package cdpscripttest brings rsc.io/script txtar-script ergonomics to Chrome DevTools Protocol (CDP) browser testing.
|
Package cdpscripttest brings rsc.io/script txtar-script ergonomics to Chrome DevTools Protocol (CDP) browser testing. |
|
report
Package report renders cdpscripttest execution reports.
|
Package report renders cdpscripttest execution reports. |
|
cmd
|
|
|
cdp
command
Cdp drives a Chrome or Brave browser over the Chrome DevTools Protocol.
|
Cdp drives a Chrome or Brave browser over the Chrome DevTools Protocol. |
|
cdpscript
command
Cdpscript runs a browser automation script.
|
Cdpscript runs a browser automation script. |
|
cdpscripttest
command
Cdpscripttest runs CDP browser automation scripts as tests.
|
Cdpscripttest runs CDP browser automation scripts as tests. |
|
chdb
command
Chdb is a debugger for pages running in Chrome.
|
Chdb is a debugger for pages running in Chrome. |
|
chrome-to-har
command
Chrome-to-har records browser activity as a HAR file.
|
Chrome-to-har records browser activity as a HAR file. |
|
churl
command
Churl fetches URLs through a real browser.
|
Churl fetches URLs through a real browser. |
|
native-host
command
Native-host is the Chrome native messaging host for the extension in extension/.
|
Native-host is the Chrome native messaging host for the extension in extension/. |
|
ndp
command
Ndp debugs Node.js processes and Chrome browsers over the inspector protocol.
|
Ndp debugs Node.js processes and Chrome browsers over the inspector protocol. |
|
internal
|
|
|
blocking
Package blocking evaluates URL and domain allow and block rules.
|
Package blocking evaluates URL and domain allow and block rules. |
|
browser
Package browser provides abstractions for managing Chrome browser instances.
|
Package browser provides abstractions for managing Chrome browser instances. |
|
browserprofile
Package browserprofile copies browser profiles into working directories for isolated browser sessions.
|
Package browserprofile copies browser profiles into working directories for isolated browser sessions. |
|
cdpinput
Package cdpinput parses CSS viewport coordinates and dispatches CDP mouse input.
|
Package cdpinput parses CSS viewport coordinates and dispatches CDP mouse input. |
|
cdpproto
Package cdpproto records the DevTools protocol surface this tree is built against, so that tests can catch two kinds of silent drift.
|
Package cdpproto records the DevTools protocol surface this tree is built against, so that tests can catch two kinds of silent drift. |
|
cdpproto/gen
command
Gen writes the list of DevTools protocol command and event names defined by the cdproto version this module depends on.
|
Gen writes the list of DevTools protocol command and event names defined by the cdproto version this module depends on. |
|
cdpproxy
Package cdpproxy provides a Chrome DevTools Protocol proxy for observing and logging CDP messages.
|
Package cdpproxy provides a Chrome DevTools Protocol proxy for observing and logging CDP messages. |
|
chromedp
Package chromedp is a high level Chrome DevTools Protocol client that simplifies driving browsers for scraping, unit testing, or profiling web pages using the CDP.
|
Package chromedp is a high level Chrome DevTools Protocol client that simplifies driving browsers for scraping, unit testing, or profiling web pages using the CDP. |
|
chromedp/device
Package device contains device emulation definitions for use with chromedp's Emulate action.
|
Package device contains device emulation definitions for use with chromedp's Emulate action. |
|
chromedp/kb
Package kb provides keyboard mappings for Chrome DOM Keys for use with input events.
|
Package kb provides keyboard mappings for Chrome DOM Keys for use with input events. |
|
coverage
Package coverage collects per-file, per-line JavaScript and CSS coverage data from a Chrome DevTools Protocol session.
|
Package coverage collects per-file, per-line JavaScript and CSS coverage data from a Chrome DevTools Protocol session. |
|
differential
Package differential captures browser states and compares their resources, performance, and content.
|
Package differential captures browser states and compares their resources, performance, and content. |
|
discovery
Package discovery locates installed Chromium browsers and their profiles.
|
Package discovery locates installed Chromium browsers and their profiles. |
|
docscan
Package docscan reports the flags a command registers, so that tests can check the command's documentation against its actual surface.
|
Package docscan reports the flags a command registers, so that tests can check the command's documentation against its actual surface. |
|
htmltomd
Package htmltomd converts HTML to Markdown.
|
Package htmltomd converts HTML to Markdown. |
|
recorder
Package recorder records browser network traffic and annotations as HAR data.
|
Package recorder records browser network traffic and annotations as HAR data. |
|
scriptbrowser
Package scriptbrowser lets commands in this module run a cdpscript.Engine against a browser they already own.
|
Package scriptbrowser lets commands in this module run a cdpscript.Engine against a browser they already own. |
|
scrub
Package scrub detects and redacts secrets in text and HAR data.
|
Package scrub detects and redacts secrets in text and HAR data. |
|
sitegroup
Package sitegroup provides stable filesystem grouping keys for network hosts.
|
Package sitegroup provides stable filesystem grouping keys for network hosts. |
|
sourcemap
Package sourcemap extracts code chunks from coverage byte ranges and generates sourcemap v3 files for synthetic source attribution.
|
Package sourcemap extracts code chunks from coverage byte ranges and generates sourcemap v3 files for synthetic source attribution. |
|
sources
Package sources captures JavaScript and CSS sources (including sourcemapped originals) from a Chrome DevTools Protocol session.
|
Package sources captures JavaScript and CSS sources (including sourcemapped originals) from a Chrome DevTools Protocol session. |
|
targets
Package targets discovers browser debugging targets through HTTP JSON endpoints.
|
Package targets discovers browser debugging targets through HTTP JSON endpoints. |
|
termmd
Package termmd renders Markdown for terminal output.
|
Package termmd renders Markdown for terminal output. |
|
testutil
Package testutil provides browser discovery, profile fixtures, and output capture for tests.
|
Package testutil provides browser discovery, profile fixtures, and output capture for tests. |
|
tooldef
Package tooldef parses .cdp tool definition files for the MCP server.
|
Package tooldef parses .cdp tool definition files for the MCP server. |
|
validation
Package validation checks user-supplied names, paths, URLs, and headers before use.
|
Package validation checks user-supplied names, paths, URLs, and headers before use. |
|
wsorigin
Package wsorigin checks WebSocket handshake origins for local debug servers.
|
Package wsorigin checks WebSocket handshake origins for local debug servers. |
Click to show internal directories.
Click to hide internal directories.