Revert "Attach shared workers through browser-level auto-attach (#424)" - #432
Merged
Merged
Conversation
This reverts commit 7cf9c46.
hiroTamada
approved these changes
Oct 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reverts #424 (
7cf9c46).Why
#424 made the telemetry monitor send a browser-level
Target.setAutoAttach(filtered toshared_worker,waitForDebuggerOnStart: false) in every browser. Chromium treats any client with browser-level auto-attach as a debugger that wants new popups paused:TargetHandler::ShouldThrottlePopups()returnsauto_attach_without consulting the filter or the wait flag. Everywindow.openpopup is then created withwait_for_debugger, and the renderer sits in a nested pause loop (WebDevToolsAgentImpl::WaitForDebuggerWhenShown) until a session attached to the popup sendsRuntime.runIfWaitingForDebugger.The monitor never attaches to popups, so it never resumes them. Clients that auto-attach and resume themselves (Playwright, Puppeteer) still work; anything else — live view input, the computer API, Selenium, raw CDP — gets a popup frozen at
about:blankand an opener frozen with the "Debugger paused in another tab" infobar, since the pause disables input for the whole browsing context group.Reproduced on a fresh headful browser with no CDP client attached: one OS-level click on a sign-in-with-Google button, and also a plain
window.open('https://example.com'). A singleRuntime.runIfWaitingForDebuggeron the popup target unfreezes it.target="_blank"links are unaffected.What this changes
Straight
git revert: the monitor goes back toTarget.attachToTargetfor shared workers, and the regression test and CI entry from #424 are removed with it, since they asserted the reverted behaviour. The crash #424 targeted (a new client's auto-attach walking an ended shared worker's DevTools host) remains covered by patch 0035 in the Chromium fork.Tests
go build ./...,go vet, andgo test ./lib/browsersurface ./lib/cdpmonitorpass.window.open) has the popup navigate normally; onmainthe same check hangs insidewindow.open.Note
Medium Risk
Changes CDP target attachment for telemetry shared workers and reintroduces the ended-worker DevTools host issue #424 addressed (mitigated separately in the Chromium fork).
Overview
Reverts browser-level
Target.setAutoAttachforshared_workertargets introduced in #424. Shared workers are tracked again through normal discovery andTarget.attachToTarget, alongside service workers and OOPIFs; only dedicatedworkertargets stay parent/auto-attach only.The Chrome E2E regression
TestNewClientAutoAttachAfterMonitoredSharedWorkerEndsand its CI filter entry are removed, andbrowsersurfaceunit tests no longer assert the shared-worker auto-attach path.cdpmonitorREADME is updated to match.This trades the #424 crash workaround for fixing a Chromium side effect where any browser-level auto-attach throttles
window.openpopups (frozen atabout:blankuntil another client resumes them), which broke live view, computer API, and non-Playwright CDP clients.Reviewed by Cursor Bugbot for commit 3b77c93. Bugbot is set up for automated code reviews on this repo. Configure here.