Skip to content

Skip pages without a renderer when connecting over CDP - #85

Open
kblok wants to merge 2 commits into
mainfrom
port/cdp-no-renderer
Open

kblok wants to merge 2 commits into
mainfrom
port/cdp-no-renderer

Conversation

@kblok

@kblok kblok commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Connecting over CDP to a browser with a crashed or discarded tab reported that tab as a blank page that never finished loading. This ports the upstream fix (microsoft/playwright#42936, #43075). While ConnectOverCDPAsync attaches to existing targets, it now waits for every page to initialize. A page that reports Inspector.targetCrashed in that window is closed instead of reported. A popup whose opener was dropped this way returns null from OpenerAsync().

The discarded-tab test clicks through chrome://discards, which exposed two selector gaps against upstream: GetByText did not look inside open shadow roots, and <tr> had no implicit row role. Both are fixed. That test needs headed Chromium, so the Linux headless CI job now runs under xvfb-run, as upstream does for all Linux jobs. A page whose initialization fails still counts as initialized, so connecting cannot hang on it.

Closes #25

🤖 Generated with Claude Code

kblok and others added 2 commits October 6, 2026 03:38
Port upstream #42936 and #43075. While connectOverCDP attaches to existing
targets, it now waits for every page to initialize. A page that reports
Inspector.targetCrashed during that window (crashed, discarded, unloaded)
is closed right away instead of being reported, and a popup whose opener
was dropped this way has no opener.

The discarded-tab test drives chrome://discards, which needed two selector
fixes to match upstream: getByText now pierces open shadow roots, and <tr>
has the implicit "row" role.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The discarded-tab test forces headless: false, like upstream. Upstream runs
every Linux test job under xvfb-run, so do the same for the Chromium
headless job instead of skipping the test there.

A page whose InitializeAsync fails now still completes InitializedTask, the
way upstream reportAsNew(error) does, so connectOverCDP cannot hang on it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

Port missing upstream tests from library/chromium/connect-over-cdp.spec.ts (3)

1 participant