feat: forward ignoreDefaultArgs to chrome-launcher
Merged
CA
6mo ago+243+243+012345678901234567890123456789-1-1-0123456789
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 and forwards it to chrome-launcher so users can drop all or selected default flags while keeping Stagehand and user flags.
- New Features
- Added
ignoreDefaultArgstoLaunchLocalOptionsand wired it through V3 tolaunchLocalChrome(), mapping tochrome-launcher’signoreDefaultFlags. truedrops allchrome-launcherdefaults;string[]removes only exact-matched defaults and re-adds the rest fromLauncher.defaultFlags(), preserving Stagehand defaults and userchromeFlags.
- Added