Skip to content

Update Chrome DevTools Protocol bindings to latest upstream spec#137

Draft
Copilot wants to merge 2 commits intomasterfrom
copilot/daily-progress-2026-03-18
Draft

Update Chrome DevTools Protocol bindings to latest upstream spec#137
Copilot wants to merge 2 commits intomasterfrom
copilot/daily-progress-2026-03-18

Conversation

Copy link
Contributor

Copilot AI commented Mar 19, 2026

Syncs generator/browser_protocol.json with the latest ChromeDevTools/devtools-protocol upstream and regenerates all Python bindings. JS protocol was already current.

New domains

Module Commands Events Types
cdp.smart_card_emulation 12 14 9 (PC/SC error codes, reader states, protocols)
cdp.web_mcp 1 2 2 (MCP tool definitions)

New APIs in existing domains

Domain New Commands New Events New Types
network configureDurableMessages, enableDeviceBoundSessions, fetchSchemefulSite 4 (device bound session events) 17 (DeviceBoundSession family)
emulation setPrimaryScreen, updateScreen screenOrientationLockChanged
extensions getExtensions, triggerAction ExtensionInfo
overlay setShowInspectedElementAnchor 2 InspectedElementAnchorConfig
css setNavigationText CSSNavigation
dom adRelatedStateUpdated, adoptedStyleSheetsModified StyleSheetId
audits 7 (PermissionElement, Performance, ConnectionAllowlist issues)
page getAnnotatedPageContent
target getDevToolsTarget
tracing getTrackEventDescriptor

Generator fix

The cleanup pass before regeneration now skips dotfiles (previously deleted committed files like .bish-index).

# Before
if subpath.is_file() and subpath.name not in ('py.typed', 'util.py', 'connection.py', '__init__.py'):
# After
if subpath.is_file() and subpath.name not in (...) and not subpath.name.startswith('.'):
Original prompt

This section details on the original issue you should resolve

<issue_title>Daily Progress: 2026-03-18</issue_title>
<issue_description>## Daily Continuous Progress

This issue tracks continuous progress for 2026-03-18.

@copilot please analyze the repository and:

  1. Review recent commits and identify the natural direction of the project
  2. Suggest next logical improvements or features to implement
  3. Create actionable tasks that align with the project goals
  4. Prioritize quick wins and incremental progress

Context:

  • Look at recent issues and PRs
  • Review README and documentation
  • Identify incomplete features or TODOs
  • Consider project structure and organization
    </issue_description>

Comments on the Issue (you are @copilot in this section)

@P4X-ng for this one please check for any new API endpoints that we don't support and lets support them @copilot

💬 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.

Copilot AI changed the title [WIP] Update project with new API endpoints support Update Chrome DevTools Protocol bindings to latest upstream spec Mar 19, 2026
Copilot AI requested a review from P4X-ng March 19, 2026 02:15
@P4X-ng P4X-ng requested a review from Copilot March 19, 2026 23:15
@P4X-ng
Copy link
Contributor

P4X-ng commented Mar 19, 2026

@cursor mind giving this a second look please?

@cursor
Copy link

cursor bot commented Mar 19, 2026

No PR-scoped findings.

Residual risks / testing gaps:

  • python3 -m pytest -q generator/test_generate.py test/test_cdp.py passes (26 passed).
  • Regenerating from generator/browser_protocol.json via python3 generator/generate.py produced no further diff, so the committed bindings/docs are self-consistent.
  • The changed modules compile cleanly (python3 -m compileall cdp) and the touched domains import successfully.
  • A full python3 -m pytest -q run still fails, but in files outside this PR’s diff:
    • test/test_connection.py:57 and similar cases patch cdp.connection.websockets.connect, but cdp.connection does not expose a websockets attribute when the optional dependency is absent.
    • test_pf_commands.py:8 is being collected by pytest as a test even though test_command(cmd, name, timeout=30) is a helper-style function with unresolved fixtures.
  • GitHub checks for PR Update Chrome DevTools Protocol bindings to latest upstream spec #137 were still queued/in progress when I checked, so there isn’t yet CI signal on the branch from the remote side.

Change summary:

  • The only handwritten code change in this PR is the generator cleanup guard in generator/generate.py, which correctly preserves dotfiles while clearing generated outputs.
  • Everything else in the diff looks like expected spec sync/regeneration, including the new smart_card_emulation and web_mcp domains plus the added cdp/__init__.py imports.
Open in Web Open in Cursor 

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 SmartCardEmulation and WebMCP, 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```.
Copy link

Copilot AI Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
:param scrollbar_type: **(EXPERIMENTAL)** *(Optional)* Scrollbar type. Default: ```default```.
:param scrollbar_type: **(EXPERIMENTAL)** *(Optional)* Scrollbar type. Default: ``default``.

Copilot uses AI. Check for mistakes.
@@ -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.
Copy link

Copilot AI Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
: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.

Copilot uses AI. Check for mistakes.
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.`
Copy link

Copilot AI Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
it returns unmodified random() function parts.`
it returns unmodified random() function parts.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Daily Progress: 2026-03-18

3 participants