feat(browser): add extraArgs config for custom Chrome launch arguments

Adds a `browser.extraArgs` config option (string array) that is appended
to Chrome's launch arguments. This enables users to add stealth flags,
window size overrides, custom user-agent strings, or other Chrome flags
without patching the source code.

Example config:
  browser.extraArgs: ["--window-size=1920,1080", "--disable-infobars"]

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
JayMishra-github
2026-02-16 10:17:34 -08:00
committed by Peter Steinberger
parent de900bace8
commit 039fc1e04c
3 changed files with 17 additions and 0 deletions

View File

@@ -217,6 +217,11 @@ export async function launchOpenClawChrome(
// Stealth: hide navigator.webdriver from automation detection (#80)
args.push("--disable-blink-features=AutomationControlled");
// Append user-configured extra arguments (e.g., stealth flags, window size)
if (resolved.extraArgs.length > 0) {
args.push(...resolved.extraArgs);
}
// Always open a blank tab to ensure a target exists.
args.push("about:blank");