fix(mcp): propagate --browser channel on --extension path#40567
Merged
yury-s merged 2 commits intomicrosoft:mainfrom May 1, 2026
Merged
fix(mcp): propagate --browser channel on --extension path#40567yury-s merged 2 commits intomicrosoft:mainfrom
yury-s merged 2 commits intomicrosoft:mainfrom
Conversation
The extension server backend called createBrowser(config, clientInfo),
a thin wrapper that passed {} as cliOptions to createBrowserWithInfo.
resolveChannelForExtension({}) then ignored the parsed --browser flag
and fell back to "chrome", so e.g. --extension --browser chrome-beta
silently spawned regular Chrome with Chrome's user-data-dir.
Inline the wrapper at the two call sites so the extension path threads
the actual CLIOptions through.
Fixes: microsoft/playwright-mcp#1589
This comment has been minimized.
This comment has been minimized.
pavelfeldman
reviewed
May 1, 2026
pavelfeldman
approved these changes
May 1, 2026
Adds a regression test that asserts --browser=chrome-dev --extension resolves to the chrome-dev default user-data-dir (visible in the "Playwright Extension not found" error). Also drops the now-redundant extension-specific server backend in program.ts: the unified factory already threads CLIOptions into createBrowserWithInfo and works for the extension path. The cli-cdp.spec.ts CDP-channel cases are switched from chrome-canary to chrome-dev to keep the channel choice consistent across MCP tests.
Contributor
Test results for "MCP"2 failed 6861 passed, 1015 skipped Merge workflow run. |
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.
Summary
createBrowser, a thin wrapper that passed{}ascliOptionstocreateBrowserWithInfo.resolveChannelForExtension({})ignored--browserand fell back tochrome, so e.g.--extension --browser chrome-betasilently spawned regular Chrome with Chrome's user-data-dir.CLIOptionsthrough, and drop the now-redundant extension-specific server backend inprogram.ts— the unified factory already does the right thing.--browser=chrome-dev --extensionresolves to the chrome-dev default user-data-dir (visible in the "Playwright Extension not found" error).Fixes microsoft/playwright-mcp#1589