fix: avoid injected accept-language headless signal#542
Open
BoSuYxxxOfficial wants to merge 1 commit into
Open
fix: avoid injected accept-language headless signal#542BoSuYxxxOfficial wants to merge 1 commit into
BoSuYxxxOfficial wants to merge 1 commit into
Conversation
Filter accept-language out of fingerprint-suite extra headers while preserving the generated language through Playwright's native locale option. This fixes the headless signal without leaving navigator locale injection inconsistent. Constraint: keep the change narrow to fingerprint-injector header and locale behavior. Rejected: adding a new ignoreHeaders option, because the maintainer explicitly preferred avoiding more granular options. Confidence: high; unit tests and live areyouheadless checks pass for Playwright and Puppeteer. Scope-risk: low-to-medium; affects default injected request header behavior for accept-language. Directive: claim apify#178 bounty only after PR is opened and reviewed by maintainers/Algora. Tested: pnpm build; pnpm exec vitest run test/fingerprint-injector/fingerprint-injector.test.ts -t 'accept-language|native locale'; pnpm exec prettier packages/fingerprint-injector/src/fingerprint-injector.ts test/fingerprint-injector/fingerprint-injector.test.ts --check; pnpm lint; live Playwright/Puppeteer areyouheadless checks. Not-tested: full browser suite with channel: chrome, because system Google Chrome is not installed and installer requires sudo.
Author
|
@algora-pbc /claim #178 |
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
accept-languageout of fingerprint-injector extra HTTP headersfingerprint.navigator.languagethrough the nativelocalecontext optionnewInjectedContextoptionsWhy
Issue #178 tracks fingerprint injection making Chromium detectable by
areyouheadless. The issue thread narrowed one reproducible cause to injecting generatedaccept-languageas an extra header. Removing that header fixes the detection signal, while using Playwrightlocalekeeps the browser context aligned with the generated navigator language instead of silently falling back to the default locale.Verification
pnpm buildpnpm exec vitest run test/fingerprint-injector/fingerprint-injector.test.ts -t 'accept-language|native locale'pnpm exec prettier packages/fingerprint-injector/src/fingerprint-injector.ts test/fingerprint-injector/fingerprint-injector.test.ts --checkpnpm lint(0 errors; existing warnings in unrelated JS files)areyouheadlesschecks returnedYou are not Chrome headlessfor:newInjectedContextxvfb-runusingnewInjectedContextnewInjectedPageNote
The local full browser test matrix cases that explicitly use
channel: "chrome"could not be run because system Google Chrome is not installed at/opt/google/chrome/chrome, andpnpm exec playwright install chromerequires sudo in this environment.Fixes #178
@algora-pbc /claim #178