fix(mcp): ignore browser config when attaching to extension#40475
fix(mcp): ignore browser config when attaching to extension#40475yury-s merged 5 commits intomicrosoft:mainfrom
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Extension mode only takes channel/browser name from CLI/env; user data dir is always the browser default. Tests can override the user data dir via the PWTEST_EXTENSION_USER_DATA_DIR env var.
The extension code path no longer reads userDataDir/executablePath/ launchOptions from config; only channel is read, and channel is effectively the browser name, which is fine to source from the config file too.
LocalBrowserConfig / CDPBrowserConfig / RemoteBrowserConfig / ExtensionBrowserConfig (each tagged with `mode`). Extension drops launchOptions/contextOptions/userDataDir, has `isolated: false` literal and `browserName: 'chromium'` literal so call sites can use plain `config.browser.isolated` / `config.browser.browserName` and TS narrows extension correctly. createBrowserWithInfo splits into createAttachedBrowser (no FullConfig needed) and createLocalBrowserWithInfo. Adds `acquireBrowserContext` helper to dedupe newContext-vs-contexts[0] across three call sites.
…ed union" This reverts commit d80df29.
d80df29 to
76ae9ac
Compare
Test results for "MCP"83 failed 6738 passed, 927 skipped Merge workflow run. |
Summary
browsersection of the loaded config file is now ignored (bothuserDataDirandexecutablePath) — only the browser/channel from the CLI flag orPLAYWRIGHT_MCP_BROWSERenv applies, matching the documented intent of theextensionconfig option.defaultUserDataDirForChannel(channel); tests can override via the newPWTEST_EXTENSION_USER_DATA_DIRenv var.createExtensionBrowserno longer takesFullConfig— it just receives the resolved channel. NewresolveChannelForExtensionhelper extracted inconfig.ts, withresolveBrowserParamfactored out ofconfigFromCLIOptionsfor reuse.custom executablePathextension test since that path is no longer wired through.