[feat]: forward `ignoreDefaultArgs` to chrome-launcher
thanks @CalebBarnes for the contribution! (original PR: #2074)
why
When running Stagehand locally, chrome-launcher adds its own set of default flags (e.g. --disable-extensions). There's currently no way for consumers to selectively remove these flags —
localBrowserLaunchOptions.chromeFlags can only add flags, not remove chrome-launcher's built-in defaults.
This is needed when users want to run Chrome with extensions enabled, or need to remove other chrome-launcher defaults for their use case.
what changed
- Added
ignoreDefaultArgsoption toLaunchLocalOptionsinlocal.ts - Forwarded
localBrowserLaunchOptions.ignoreDefaultArgsfromv3.tsthrough tolaunchLocalChrome() - When
true: drops all chrome-launcher defaults (only Stagehand's own flags and user-suppliedchromeFlagsare used) - When
string[]: selectively removes only the listed flags from chrome-launcher defaults, keeping the rest
This mirrors the behavior of Playwright's
ignoreDefaultArgs option.
test plan
- Verified locally that setting
ignoreDefaultArgs: ["--disable-extensions"]successfully removes the flag from the launched Chrome instance (confirmed viachrome://version/) - Verified that other chrome-launcher defaults are preserved when using the array form
- Verified that
ignoreDefaultArgs: truedrops all chrome-launcher defaults
Summary by cubic
Adds ignoreDefaultArgs to local Chrome launch so you can drop all or selected default flags from chrome-launcher with exact-match control (including Stagehand defaults), while keeping your own args.
- New Features
- Added
ignoreDefaultArgstoLaunchLocalOptionsand moved flag assembly intolaunchLocalChrome(), forwarding tochrome-launcherviaignoreDefaultFlags. truedrops allchrome-launcherdefaults;string[]removes only exact-matched defaults and re-adds the rest fromLauncher.defaultFlags(). Stagehand defaults and userargsstay unless explicitly listed.
- Added