Skip to content

fix(local-browser): disable AutomationControlled only in headless Chrome/Edge - #186

Merged
Winify merged 1 commit into
webdriverio:mainfrom
kingdom84521:fix/headed-automation-controlled
Nov 5, 2026
Merged

Winify merged 1 commit into
webdriverio:mainfrom
kingdom84521:fix/headed-automation-controlled

Conversation

@kingdom84521

Copy link
Copy Markdown
Contributor

Proposed changes

Fixes #185

--disable-blink-features=AutomationControlled moves from the unconditional chromiumArgs list into the effectiveHeadless block, next to --headless=new. This matches the description of #159, which scoped the flag to headless sessions.

Headed Chrome/Edge sessions report navigator.webdriver === true again, so apps under test that check it can detect automation. User args could not undo the flag, because Chrome merges repeated --disable-blink-features values.

Place Change
src/providers/local-browser.provider.ts Flag pushed only when effectiveHeadless is true
tests/providers/local-browser.provider.test.ts The existing case now passes headless: true; a new case checks that headed Chrome/Edge do not get the flag

How you tested

Command Result
npx vitest run tests/providers/local-browser.provider.test.ts with src/ from main The 2 new headed cases fail
Same, with this branch 19 passed
pnpm test 893 passed, 33 skipped
eslint src/ tests/, tsc --noEmit No errors

Real browser: Chromium 156 under xvfb-run in mcr.microsoft.com/playwright:v1.64.0-noble. The script called startSessionTool (provider: 'local', browser: 'chrome') and then executeScriptTool with return navigator.webdriver:

headless main This branch
false false true
true false false

Types of changes

  • Polish (an improvement for an existing feature)
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update (improvements to the project's docs)
  • Specification changes (updates to WebDriver command specifications)
  • Internal updates (everything related to internal scripts, governance documentation and CI files)

Checklist

  • I have squashed commits that belong together
  • I have tested with Claude Desktop (or another MCP-compatible client)
  • I have read the CONTRIBUTING doc
  • I have added the necessary documentation for new/changed tools (if appropriate)
  • I have added proper type definitions for new commands (if appropriate)

Further comments

The real-browser check called the tool callbacks directly rather than through an MCP client, so the client checkbox is left unchecked.

Reviewers: @webdriverio/project-committers

🤖 Generated with Claude Code

…ome/Edge

The flag sat in the unconditional chromiumArgs list, so headed sessions
also reported navigator.webdriver = false, and user args cannot undo it
because Chrome merges repeated --disable-blink-features values.
Push it next to --headless=new, matching the intent of webdriverio#159.

Fixes webdriverio#185

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@linux-foundation-easycla

linux-foundation-easycla Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: danny-huang-openfind / name: danny_huang (15e567b)

@greptile-apps

greptile-apps Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge.

Summary

Limits --disable-blink-features=AutomationControlled to headless local Chrome/Edge sessions.

  • Local Chrome and Edge sessions use the webdriver flag only in headless mode.

Reviews (1) · Last reviewed commit: "fix(local-browser): disable AutomationCo..." · Reviewed by Greptile

@Winify
Winify merged commit b62dff3 into webdriverio:main Nov 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AutomationControlled is disabled in headed Chrome/Edge sessions too, not only headless

3 participants