feat(extensions): expose extension popup as page event#41260
Draft
Skn0tt wants to merge 5 commits into
Draft
Conversation
…t#40554) Adds an MV3 popup extension asset and an it.fixme test asserting that an extension action popup should surface as a context 'page' event. Currently blocked upstream: initializing the popup target as a CRPage under PW_CHROMIUM_ATTACH_TO_OTHER crashes Chrome. The launchPersistentContext fixture now appends options.args additively so tests can pass extra Chromium flags.
Experimental, PW_PROBE-gated scaffolding (NOT for shipping). Demonstrates that a tab-target migration CAN capture a popup's first navigation request when Network.enable is enqueued synchronously and the paused renderer is resumed immediately after (without awaiting the enable ack). Finding: requestWillBeSent + responseReceived are delivered to the popup's own page session and the popup surfaces as a context event. The only gap is Network.loadingFinished, which Chrome routes to the tab/browser session (no Network domain) instead of the page session, so response.finished() hangs. This is a narrow session-routing issue, not the structural "first request is lost" limitation previously assumed. Default behavior is unchanged when PW_PROBE is unset.
Connection-level CDP tap + waitingForDebugger logging establish, across three resume orderings, why the tab-target model cannot preserve the popup main-request lifecycle: - nested page attaches UN-paused (pre-exists the tab setAutoAttach); - tab-level pause freezes Network.enable on the page session; - await-ack-before-resume deadlocks -> ERR_ABORTED + target teardown; - enqueue+resume-together captures will+response (replayed from cached metadata) but Chrome never streams dataReceived/loadingFinished. Classic mode works only because the page attaches PAUSED at the page level, where domain setup completes before the renderer is resumed.
The tab-target migration cannot preserve the popup main-request lifecycle guarantee (page-network-request.spec.ts:478) -- see the two preceding WIP commits for the empirical proof. Restoring the chromium core files to baseline so the branch ships only the safe deliverable (extension-popup asset + documented it.fixme test).
Member
Author
|
@copilot resolve the merge conflicts in this pull request |
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.
See #40554