Update Chrome DevTools Protocol bindings to latest upstream spec#137
Update Chrome DevTools Protocol bindings to latest upstream spec#137
Conversation
…w API endpoints Co-authored-by: P4X-ng <[email protected]>
|
@cursor mind giving this a second look please? |
|
No PR-scoped findings. Residual risks / testing gaps:
Change summary:
|
There was a problem hiding this comment.
Pull request overview
This PR syncs the repository’s Chrome DevTools Protocol (CDP) spec to the latest upstream ChromeDevTools/devtools-protocol and regenerates the Python bindings + Sphinx API docs accordingly, including new experimental domains and newly added/removed protocol surfaces.
Changes:
- Update CDP spec inputs and regenerate Python domain modules (types/commands/events) to match upstream.
- Add new experimental domains
SmartCardEmulationandWebMCP, and extend several existing domains (e.g.,Network,Emulation,Overlay,Target,Tracing,Audits,DOM,CSS,Extensions,Page). - Fix generator cleanup to preserve dotfiles in
cdp/output (e.g.,.bish-index,.bish.sqlite) during regeneration.
Reviewed changes
Copilot reviewed 27 out of 28 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| generator/generate.py | Preserve dotfiles during generated-code cleanup before regeneration. |
| docs/api/audits.rst | Update Audits docs to reflect new/removed types/commands. |
| docs/api/css.rst | Update CSS docs for new/removed types/commands. |
| docs/api/dom.rst | Document new DOM types/events (e.g., stylesheet/ad-related additions). |
| docs/api/emulation.rst | Document new Emulation commands/events and parameters. |
| docs/api/extensions.rst | Document new Extensions types/commands. |
| docs/api/network.rst | Document Network domain additions (durable messages, sessions, etc.) and removals. |
| docs/api/overlay.rst | Document new Overlay type/command/events. |
| docs/api/page.rst | Update Page docs (remove moved types, add new command). |
| docs/api/smart_card_emulation.rst | New Sphinx API docs page for the SmartCardEmulation domain. |
| docs/api/target.rst | Document new Target command. |
| docs/api/tracing.rst | Document new Tracing command. |
| docs/api/web_mcp.rst | New Sphinx API docs page for the WebMCP domain. |
| cdp/init.py | Export/import newly generated domains. |
| cdp/audits.py | Regenerate Audits bindings for upstream changes (new issue types/details, removals). |
| cdp/browser.py | Update Browser enums for new permission types. |
| cdp/css.py | Regenerate CSS bindings (StyleSheetId relocation, navigation at-rule support, API changes). |
| cdp/dom.py | Add StyleSheetId and new node fields/events for adopted stylesheets and ad-related state. |
| cdp/emulation.py | Add new screen APIs and orientation lock event; update device metrics override params. |
| cdp/extensions.py | Add new extension APIs/types and extend existing commands. |
| cdp/network.py | Major Network regeneration: durable messages config, device-bound sessions, type/event updates, removals/renames. |
| cdp/overlay.py | Add inspected-element anchor config, command, and new events. |
| cdp/page.py | Add annotated page content command and align ad ancestry types with Network. |
| cdp/smart_card_emulation.py | New generated SmartCardEmulation domain module. |
| cdp/target.py | Update Target APIs (new command, new params, updated return shape). |
| cdp/tracing.py | Add get_track_event_descriptor command binding. |
| cdp/web_mcp.py | New generated WebMCP domain module. |
| :param viewport: **(EXPERIMENTAL)** *(Optional)* If set, the visible area of the page will be overridden to this viewport. This viewport change is not observed by the page, e.g. viewport-relative elements do not change positions. | ||
| :param display_feature: **(DEPRECATED)** **(EXPERIMENTAL)** *(Optional)* If set, the display feature of a multi-segment screen. If not set, multi-segment support is turned-off. Deprecated, use Emulation.setDisplayFeaturesOverride. | ||
| :param device_posture: **(DEPRECATED)** **(EXPERIMENTAL)** *(Optional)* If set, the posture of a foldable device. If not set the posture is set to continuous. Deprecated, use Emulation.setDevicePostureOverride. | ||
| :param scrollbar_type: **(EXPERIMENTAL)** *(Optional)* Scrollbar type. Default: ```default```. |
There was a problem hiding this comment.
The scrollbar_type parameter docstring uses Markdown-style triple backticks (default) inside a reST docstring, which tends to render poorly under Sphinx autodoc. Since the upstream spec uses single backticks for inline code, consider normalizing inline-code markup during generation (e.g., convert to default) so API docs render correctly.
| :param scrollbar_type: **(EXPERIMENTAL)** *(Optional)* Scrollbar type. Default: ```default```. | |
| :param scrollbar_type: **(EXPERIMENTAL)** *(Optional)* Scrollbar type. Default: ``default``. |
| @@ -379,6 +386,7 @@ def create_target( | |||
| :param background: *(Optional)* Whether to create the target in background or foreground (false by default, not supported by headless shell). | |||
| :param for_tab: **(EXPERIMENTAL)** *(Optional)* Whether to create the target of type "tab". | |||
| :param hidden: **(EXPERIMENTAL)** *(Optional)* Whether to create a hidden target. The hidden target is observable via protocol, but not present in the tab UI strip. Cannot be created with ```forTab: true````, ````newWindow: true```` or ````background: false```. The life-time of the tab is limited to the life-time of the session. | |||
There was a problem hiding this comment.
The hidden parameter description contains malformed inline-code markup (mismatched/multiple backticks around forTab, newWindow, and background). This appears to be a generation artifact (the upstream spec uses single-backtick inline code) and will render poorly in Sphinx/autodoc output; consider fixing the generator’s backtick/inline-code conversion so these snippets render as proper reST inline literals.
| :param hidden: **(EXPERIMENTAL)** *(Optional)* Whether to create a hidden target. The hidden target is observable via protocol, but not present in the tab UI strip. Cannot be created with ```forTab: true````, ````newWindow: true```` or ````background: false```. The life-time of the tab is limited to the life-time of the session. | |
| :param hidden: **(EXPERIMENTAL)** *(Optional)* Whether to create a hidden target. The hidden target is observable via protocol, but not present in the tab UI strip. Cannot be created with `forTab: true`, `newWindow: true` or `background: false`. The life-time of the tab is limited to the life-time of the session. |
| syntax as if null ``propertyName`` was provided. If the value cannot be | ||
| resolved even then, return the provided value without any changes. | ||
| Note: this function currently does not resolve CSS random() function, | ||
| it returns unmodified random() function parts.` |
There was a problem hiding this comment.
The resolve_values docstring ends with an unmatched backtick ("parts.`"), which will render oddly in generated documentation and looks like a typo from the upstream spec. Consider stripping/escaping unmatched backticks during generation (or patching this specific docstring) so the rendered docs don’t contain stray markup.
| it returns unmodified random() function parts.` | |
| it returns unmodified random() function parts. |


Syncs
generator/browser_protocol.jsonwith the latestChromeDevTools/devtools-protocolupstream and regenerates all Python bindings. JS protocol was already current.New domains
cdp.smart_card_emulationcdp.web_mcpNew APIs in existing domains
networkconfigureDurableMessages,enableDeviceBoundSessions,fetchSchemefulSiteDeviceBoundSessionfamily)emulationsetPrimaryScreen,updateScreenscreenOrientationLockChangedextensionsgetExtensions,triggerActionExtensionInfooverlaysetShowInspectedElementAnchorInspectedElementAnchorConfigcsssetNavigationTextCSSNavigationdomadRelatedStateUpdated,adoptedStyleSheetsModifiedStyleSheetIdauditspagegetAnnotatedPageContenttargetgetDevToolsTargettracinggetTrackEventDescriptorGenerator fix
The cleanup pass before regeneration now skips dotfiles (previously deleted committed files like
.bish-index).Original prompt
💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.