fix(mcp): merge user ignoreDefaultArgs with persistent mode defaults#40026
Open
lennondotw wants to merge 1 commit intomicrosoft:mainfrom
Open
fix(mcp): merge user ignoreDefaultArgs with persistent mode defaults#40026lennondotw wants to merge 1 commit intomicrosoft:mainfrom
lennondotw wants to merge 1 commit intomicrosoft:mainfrom
Conversation
The hardcoded `ignoreDefaultArgs: ['--disable-extensions']` in createPersistentBrowser was overwriting user-provided ignoreDefaultArgs from the config file. Now the two lists are merged, and `ignoreDefaultArgs: true` passes through correctly.
Skn0tt
reviewed
Apr 2, 2026
Member
Skn0tt
left a comment
There was a problem hiding this comment.
looks good, thanks for the PR!
| ], | ||
| ignoreDefaultArgs: userIgnoreDefaultArgs === true | ||
| ? true | ||
| : [...new Set([ |
Member
There was a problem hiding this comment.
no need for the Set, it's fine if there's duplicates in here.
| throw new Error(`Browser is already in use for ${userDataDir}, use --isolated to run multiple instances of the same browser`); | ||
|
|
||
| const browserType = playwright[config.browser.browserName]; | ||
| const userIgnoreDefaultArgs = config.browser.launchOptions?.ignoreDefaultArgs; |
Member
There was a problem hiding this comment.
Suggested change
| const userIgnoreDefaultArgs = config.browser.launchOptions?.ignoreDefaultArgs; | |
| const configIgnoreDefaultArgs = config.browser.launchOptions?.ignoreDefaultArgs; |
"user" is a synonym for "config" here, let's not add one more term to keep things simple
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
In
createPersistentBrowser, the hardcodedignoreDefaultArgs: ['--disable-extensions']was placed after...config.browser.launchOptionsin the object literal, silently overwriting any user-providedignoreDefaultArgsfrom the config file. This meant users could not remove specific Chromium default arguments (e.g.,--force-color-profile=srgb,--password-store=basic) when using persistent browser mode.The fix merges the persistent mode's built-in
['--disable-extensions']with the user's configured list (deduplicated viaSet), and passes throughignoreDefaultArgs: trueunchanged.Details
Root cause: In
browserFactory.ts,createPersistentBrowserconstructslaunchOptionsas:Fix: Extract
userIgnoreDefaultArgsbefore the spread, then merge:true→ passthrough (ignore all default args)string[]→ merge with['--disable-extensions']viaSet(dedup)undefined/ unset → default behavior (['--disable-extensions']only)Isolated mode is unaffected —
createIsolatedBrowserdoesn't overrideignoreDefaultArgs.Test: End-to-end test in persistent mode: sets
ignoreDefaultArgs: ['--password-store=basic']via config, navigates tochrome://version, reads the command line, and verifies:--password-store=basicis removed (user config honored)--disable-extensionsis removed (persistent mode built-in honored)--use-mock-keychainis still present (other defaults preserved)