Skip to content

feat(browser): add stealth anti-detection for CDP and daemon modes#319

Merged
jackwener merged 1 commit intomainfrom
feat/browser-stealth
Mar 23, 2026
Merged

feat(browser): add stealth anti-detection for CDP and daemon modes#319
jackwener merged 1 commit intomainfrom
feat/browser-stealth

Conversation

@jackwener
Copy link
Copy Markdown
Owner

Add stealth.ts module with 6 patches (webdriver, chrome stub, plugins, languages, permissions, artifact cleanup). CDP mode uses Page.addScriptToEvaluateOnNewDocument; daemon mode injects after navigation with guard flag. All patches are conditional to avoid overwriting real browser values. 4 new unit tests, 309/309 passing.

Add stealth.ts module that patches browser globals to hide automation
fingerprints when opencli controls a browser via CDP or daemon extension.

Patches applied:
- navigator.webdriver → undefined (CDP sets it to true)
- window.chrome stub (only if missing)
- navigator.plugins fake list (only if empty)
- navigator.languages guarantee (only if empty)
- Permissions.query normalization for notifications
- Cleanup __playwright/__puppeteer/cdc_* artifacts

CDP mode: stealth registered via Page.addScriptToEvaluateOnNewDocument
(runs before any page JS on every navigation).

Daemon mode: stealth injected via exec after navigation, with guard
flag to prevent double-injection.
@jackwener jackwener merged commit 15d9ef8 into main Mar 23, 2026
11 checks passed
@jackwener jackwener deleted the feat/browser-stealth branch March 23, 2026 17:32
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.

1 participant