Add job-level stealth toggle; scope StealthPlugin to Chromium#7
Merged
Conversation
puppeteer-extra-plugin-stealth is Chromium-specific. Its evasions patch Blink-only DOM globals and inject Chromium-only launch flags (notably `--disable-blink-features=AutomationControlled`). When the plugin is registered on WebKit or Firefox via `playwright-extra`, the launch arg is still passed through to those browsers, which reject unknown args at startup with: Cannot parse arguments: Unknown option --disable-blink-features=AutomationControlled This makes every WebKit/Firefox scan fail unconditionally on Testaro 70.2.0 — including any job with `browserID: 'webkit'` or any device whose `defaultBrowserType` is webkit (e.g. all iPhone presets from Playwright's device descriptors). Two changes: 1. Register StealthPlugin only on `playwright-extra.chromium`. WebKit and Firefox now always use plain `playwright` and launch cleanly. 2. Add an optional job-level `stealth` field (boolean, default true). When true, Chromium launches go through `playwright-extra` so the stealth evasions fire — same behavior as before for Chromium. When false, Chromium uses plain `playwright` with no evasions and no `--disable-blink-features=AutomationControlled` arg, giving integrators a way to opt out for sites whose anti-bot heuristics react badly to stealth's patches. `procs/job.js` validates `stealth` is a boolean when present. README documents the new field in the sample job block. Backwards-compatible: jobs that don't set `stealth` get the historical Chromium-with-stealth behavior. WebKit/Firefox jobs that used to fail silently (or noisily) now succeed.
This was referenced May 13, 2026
jrpool
approved these changes
May 25, 2026
Owner
jrpool
left a comment
There was a problem hiding this comment.
Thank you very much for discovering this bug, which is evidence for the recently weak validation hygiene of this repository.
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.
Problem
puppeteer-extra-plugin-stealthis Chromium-specific. Its evasions patch Blink-only DOM globals and inject Chromium-only launch flags — notably--disable-blink-features=AutomationControlled.Today,
run.jsregisters the plugin on all three browser types unconditionally:playwright-extrathen passes the Chromium-only arg through to WebKit and Firefox during launch, and both browsers reject unknown CLI args at startup:The browser process exits immediately, the launch raises
browserType.launch: Target page, context or browser has been closed, and every test act fails the same way. This makes any job withbrowserID: 'webkit'or'firefox'unrunnable — and by extension, any device emulation whosedefaultBrowserTypeiswebkit(every iPhone/iPad descriptor Playwright ships).I hit this on a fan-out run from a project where four Chromium/Firefox configurations completed 8/8 engines and the one WebKit (iPhone 15 Pro Max) configuration reported 0/8 engines, all with the same root error in the worker logs.
Changes
run.js: registerStealthPluginonly onplaywright-extra.chromium. WebKit and Firefox no longer have the plugin attached, so the incompatible Chromium-only args stop leaking into their launches.procs/launch.js: pickplaywright-extravs plainplaywrightper launch based on a newuseStealthderivation. Chromium with stealth →playwright-extra(plugin fires). Chromium without stealth, or any WebKit/Firefox launch → plainplaywright. Also gate--disable-blink-features=AutomationControlledonuseStealthsince it's a stealth-only arg (hides the automation flag that stealth's other evasions assume is hidden).procs/job.js: validate optionalstealthfield — must bebooleanwhen present, omitted means "use the default" (which istrueon Chromium,falseeverywhere else).README.md: document the new field in the sample-job block.Backwards compatibility
stealthget the historical behavior on Chromium (stealth on).stealth: trueon a WebKit job is silently ignored (the plugin is never registered there).stealthis a new optional field.Why expose
stealthas a job field at allTwo reasons:
navigator.webdriver,navigator.plugins, etc.). Tests that care about the unmodified environment benefit from opting out.If you'd prefer to keep stealth always-on for Chromium and only land change (1), I'm happy to split this into two PRs — but the second change is small and the validation/docs touch the same surface, so I bundled them.
Test notes
Loaded
run.jsandprocs/launch.jsstandalone withnode --checkfor syntax. End-to-end verification was via the production worker run that surfaced the bug: with the patched testaro, the WebKit (iPhone 15 Pro Max) configuration now reports 8/8 engines like the Chromium/Firefox configurations.