fix: UA matches running Chrome, WebGL + worker spoof, tests and CI (0.3.0) - #2
Merged
Merged
Conversation
…nned 119-121 list Spoofed UA and Client Hints now carry the real major version read via CDP Browser.getVersion. An explicit fingerprint.userAgent still wins and drives Client Hints; a warning is logged when its major differs from the running browser. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013qesGnPkH8K7y8CZRhvNoi
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013qesGnPkH8K7y8CZRhvNoi
The WebGL renderer leaked the real GPU on the Puppeteer/Playwright paths: CDP addScriptToEvaluateOnNewDocument is per-session, so scripts the launcher installed on its own CDP client never reached pages the user's Puppeteer connection drove. The integrations also hand-rolled partial navigator scripts and injected no WebGL spoof at all. - Route every integration (withPuppeteer, quickLaunch, withPlaywright, quickLaunchPlaywright, patchPage) through the shared getAllProtectionScripts bundle via the automation library's native injection API. - Make the WebGL vendor/renderer deterministic per profile: persist a platform-consistent pair at profile creation (Win32 -> Intel/NVIDIA/AMD Direct3D, Mac -> Apple, Linux -> Mesa) and seed numeric params from it so repeated getParameter calls agree. - Re-inject navigator + WebGL spoof inside Worker/SharedWorker by loading the original worker through a blob prelude, fixing GitHub issue #1. Module and service workers are passed through untouched (documented limitation). - Attach the launcher CDP client at the browser target with setAutoAttach so the raw launch() path also covers pages opened later. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013qesGnPkH8K7y8CZRhvNoi
- Unit tests for createWebGLScript, pickWebGLForPlatform, getAllProtectionScripts and createWorkerSpoofScript (no browser needed). - Headless integration test launches Chrome via quickLaunch and asserts navigator + WebGL match the profile in both window and Worker contexts. Auto-skips when no Chrome binary is present so CI without a browser passes. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013qesGnPkH8K7y8CZRhvNoi
# Conflicts: # src/chrome-launcher.ts # src/fingerprint.test.ts
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013qesGnPkH8K7y8CZRhvNoi
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.
Summary
userAgentMetadatafrom it. Explicitfingerprint.userAgentstill wins, with a mismatch warning.connect()never inherited. Scripts are now injected through the automation library's native API and the launcher auto-attaches at the browser target. Vendor/renderer is picked per profile, consistent with platform, and persisted.Worker/SharedWorkerare wrapped so navigator + WebGL spoof runs before the worker script. Module/service workers pass through untouched.Verification
Headless smoke on Chrome 152 against an https page, profile platform Win32:
npm run typecheck && npm run build && npm testpass locally.Closes #1
🤖 Generated with Claude Code
https://claude.ai/code/session_013qesGnPkH8K7y8CZRhvNoi