feat(renderer): align browser locale with the proxy exit country - #511
Merged
Conversation
When a request pins a residential exit country, the chrome_proxy tier still announced a US browser: Accept-Language en-US, navigator.languages en-US, and a UTC clock. An IP/locale mismatch is a stronger bot signal than a flagged IP on its own, so the explicit country parameter was working against itself. A country table in crw_renderer::locale maps the pinned country to an Accept-Language and an IANA timezone. On the tier whose egress actually leaves from that country (the one that composes a country-suffixed proxy login) the session now sets acceptLanguage on Network.setUserAgentOverride, an Emulation timezone override, an Emulation locale override, and the stealth script's navigator.languages. A caller-supplied Accept-Language wins over every language signal; the clock still follows the exit country. With no country, or on any other tier, every path is byte-identical to before. ref #385
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
What changed
crw_renderer::locale: a 32-row country table (ISO alpha-2, plus aukalias for GB) mapping to anAccept-Languageand an IANA timezone.chrome_proxy), and only when no per-request proxy overrides that egress, the CDP session now setsacceptLanguageonNetwork.setUserAgentOverride(plain tag form, Chromium adds the weights),Emulation.setTimezoneOverride,Emulation.setLocaleOverride, and the stealth script'snavigator.languages.Accept-Languagewins over every language signal; the clock still follows the exit country.Emulationoverrides are logged at debug with the method name.What did not change
countryparameter's precedence and the proxy credential composition are untouched.Verification
cargo test -p crw-renderer --features cdp: 943 passed (933 existing + 10 new).country.Measurement for the rest of the issue
Over 806 blocked requests in three days of production traces, confirmed geo-block signatures were 0.87% (all one host), and a ccTLD prior was wrong 97% of the time. Phases 1 to 3 of the issue are not worth building; details on the issue.
ref #385