Package cdproto contains the generated commands, types, and events for the Chrome DevTools Protocol domains.
182
252 commits
updated Oct 5, 2026
Package cdproto contains the generated commands, types, and events for the
Chrome DevTools Protocol domains.
This package is generated by the pdlgen command. Please refer to
that project and to the main chromedp project for information on
using the commands, types, and events available here.
go get github.com/chromedp/cdproto@latest
The package needs Go 1.25 or later. Go 1.27 has encoding/json/v2 in the
standard library, but Go 1.25 and Go 1.26 have it only with
GOEXPERIMENT=jsonv2. To work without that setting, the package cdp/jsonv2 is
the only package that imports a JSON package. It has the names of the standard
library, such as jsonv2.Value, jsonv2.Options, jsonv2.Marshal and
jsonv2.Unmarshal. With Go 1.27, or with
GOEXPERIMENT=jsonv2, they are aliases of the standard types. In all other
cases they come from the module github.com/go-json-experiment/json. The build
tag cdproto_jsoncompat selects the module on every version of Go. With Go 1.27,
set GOEXPERIMENT=nojsonv2 as well, because the pinned version of the module
does not build with the standard package of Go 1.27.
Each protocol command is a value with a parameter type and a result type. The
function cdp.Call runs it on a session. Each protocol event is a value too.
The function cdp.Events returns an iterator for it.
res, err := cdp.Call(ctx, session, page.Navigate, page.NavigateParams{URL: "https://example.com"})
See the Go Reference for the API, and
docs/API.md in the pdlgen project for the rules that the generator follows.
A tag has the form v0.<major>.<patch>, where the minor version is the
Chromium major version of the protocol. Any release can contain incompatible
changes, because the protocol removes and renames things. CHANGELOG.md and the
annotation of each tag list the changes. The releases up to v0.157.2 have the
old API, which had a Do method on each command. The release v0.157.3 is the
first one with the typed API.
A new Chromium or V8 version alone makes no release. If the generated API is
the same, the workflow makes no commit and no tag. For this reason,
cdproto.ChromiumVersion() can name an older Chromium build than the newest
one.
If you would like to submit a change to the code in this package, please submit
your Pull Request to the pdlgen project. Any Issues and Pull
Requests submitted to this project will be closed without being reviewed.
233 followers · starred Nov 2018
69 followers · starred Sep 2022
35 followers · starred Jun 2025
Package cdproto contains the generated commands, types, and events for the Chrome DevTools Protocol domains.
182
252 commits
updated Oct 5, 2026
Package cdproto contains the generated commands, types, and events for the
Chrome DevTools Protocol domains.
This package is generated by the pdlgen command. Please refer to
that project and to the main chromedp project for information on
using the commands, types, and events available here.
go get github.com/chromedp/cdproto@latest
The package needs Go 1.25 or later. Go 1.27 has encoding/json/v2 in the
standard library, but Go 1.25 and Go 1.26 have it only with
GOEXPERIMENT=jsonv2. To work without that setting, the package cdp/jsonv2 is
the only package that imports a JSON package. It has the names of the standard
library, such as jsonv2.Value, jsonv2.Options, jsonv2.Marshal and
jsonv2.Unmarshal. With Go 1.27, or with
GOEXPERIMENT=jsonv2, they are aliases of the standard types. In all other
cases they come from the module github.com/go-json-experiment/json. The build
tag cdproto_jsoncompat selects the module on every version of Go. With Go 1.27,
set GOEXPERIMENT=nojsonv2 as well, because the pinned version of the module
does not build with the standard package of Go 1.27.
Each protocol command is a value with a parameter type and a result type. The
function cdp.Call runs it on a session. Each protocol event is a value too.
The function cdp.Events returns an iterator for it.
res, err := cdp.Call(ctx, session, page.Navigate, page.NavigateParams{URL: "https://example.com"})
See the Go Reference for the API, and
docs/API.md in the pdlgen project for the rules that the generator follows.
A tag has the form v0.<major>.<patch>, where the minor version is the
Chromium major version of the protocol. Any release can contain incompatible
changes, because the protocol removes and renames things. CHANGELOG.md and the
annotation of each tag list the changes. The releases up to v0.157.2 have the
old API, which had a Do method on each command. The release v0.157.3 is the
first one with the typed API.
A new Chromium or V8 version alone makes no release. If the generated API is
the same, the workflow makes no commit and no tag. For this reason,
cdproto.ChromiumVersion() can name an older Chromium build than the newest
one.
If you would like to submit a change to the code in this package, please submit
your Pull Request to the pdlgen project. Any Issues and Pull
Requests submitted to this project will be closed without being reviewed.
233 followers · starred Nov 2018
69 followers · starred Sep 2022
35 followers · starred Jun 2025