You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Hyphenated --chromeArg values dropped during daemon serialization and lazy subcommand startup #2406
When executing CLI subcommands with custom Chromium startup options (such as --use-fake-device-for-media-stream or --use-file-for-fake-audio-capture=...), two independent bugs previously prevented flags from reaching puppeteer.launch:
Yargs Value Collision: serializeArgs emitted options and values as detached token pairs (['--chrome-arg', '--use-fake-device...']). When initializing the spawned daemon process, yargs interpreted the hyphenated trailing token as an unrelated command option, stripping the value from --chrome-arg.
Lazy Startup Parameter Dropping: When invoking action subcommands against an inactive session, auto-start initialization called start([], sessionId). This hardcoded empty array silently discarded all browser configuration flags passed on the invocation command line.
Reproduction
Attempt to pass synthetic media flags via chrome-devtools start:
Neither --use-fake-device-for-media-stream nor --use-file-for-fake-audio-capture=/tmp/test-audio.wav appears on the /opt/google/chrome/chrome process command line.
Root Cause 1:serializeArgs(options, argv) formats array items as separate tokens (['--chrome-arg', '--use-fake-device...']). Because the value starts with --, yargs in the daemon process interprets --use-fake-device... as an unknown command option and drops --chrome-arg.
Root Cause 2: When invoking action subcommands against an inactive session, lazy auto-start calls start([], sessionId) with an empty array, dropping any startup configuration flags passed on the command line.
Expectation
Chromium launches with all requested --chromeArg flags included.
Activity
gvojta commentedon Jul 23, 2026
PR: #2405
fix(daemon): preserve hyphenated browser flags in arg serialization a…