Repository navigation
Conversation
BrowserManager#connect() (--browserUrl, --wsEndpoint, --autoConnect) built Puppeteer's target filter with makeTargetFilter() and no argument, so chrome-extension:// targets were dropped at connect time and list_pages never showed extension pages or service workers when attached. #launch() already passes the flag; do the same here. Fixes ChromeDevTools#3046
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.
Fixes #3046.
Split out of #3041 at the reviewer's request. This is the target-filter half; #3041 keeps the config change.
BrowserManager#connect(), used for--browserUrl,--wsEndpointand--autoConnect, built Puppeteer's target filter withmakeTargetFilter()and no argument. So Puppeteer dropped everychrome-extension://target at connect time, andlist_pagesnever showed extension pages or service workers when attached, even with--categoryExtensions.#launch()already passes the flag. This passes it the same way in#connect().The omission dates from #1922, whose attach call site didn't pass the flag (see #1171 and #1173). #2787 carried it into
BrowserManager.Changes
src/BrowserManager.ts: readcategoryExtensionsfrom the server args in#connect()and pass it tomakeTargetFilter().tests/browser.test.ts: two tests that connect withbrowserUrland check thetargetFilterhanded topuppeteer.connect. Achrome-extension://target is kept only whencategoryExtensionsis set. Thetruecase fails without theBrowserManagerchange.With the flag off, behaviour is unchanged:
undefinedfalls back tomakeTargetFilter'sfalsedefault.Note on reachability
On
main,--categoryExtensionswith an attach flag is currently rejected at startup (#2989, lifted in #3041). So this path can't be reached from the command line onmainuntil #3041 lands. The unit tests reach it directly. Landing this first means #3041 doesn't expose an attach mode with hidden extension pages.Testing
npm run gen(no changes) andnpm run check-format: clean.node scripts/test.js tests/browser.test.ts tests/cli.test.ts: all pass.--browserUrl http://127.0.0.1:<port> --categoryExtensions=true.list_pageslists the tab under## Extension Pages. Unpatched 1.10.1 and 1.9.0 list no extension pages.🤖 Generated with Claude Code