Entry 16 of 17
Headers against script — the same fact, said twice
Your browser states its user agent and languages twice: once in the headers of every request, and once to any script that asks. In an unmodified browser the two always agree, so a tool that changes only one of them creates a contradiction a server can see without running anything.
Where does a site read your user agent and languages?
Before any page runs, your browser has already sent its user agent and language list as request headers. The same facts are available again to script, and the two copies are expected to agree.
Every request carries a User-Agent header and an Accept-Language header, and Chromium browsers add Sec-CH-UA client hints. Script reads the same facts again through navigator.userAgent, navigator.languages and navigator.userAgentData.
In an unmodified browser the two copies come from one setting, so they agree. A spoofing extension that patches navigator in the page, or a proxy that rewrites headers on the wire, changes only one copy. The server receives the header with every request and receives the script value as soon as a page reports it, so a mismatch costs nothing to find.
This row compares the header your browser sent with the request this page made against what the same page reads in script: the full user-agent string, and the first language in each list.
What a mismatch tells a site
- Whether something rewrites your user agent or languages in only one place.
- With client hints, whether the brand list in the headers matches the browser the user-agent string names.
- Indirectly, the presence of a spoofing extension or a rewriting proxy.
Does a VPN change your request headers?
No. A tunnel carries your requests unchanged, headers included. The user agent and the language list arrive at every site exactly as your browser wrote them.
Some proxies and filtering products do rewrite headers. They seldom change what script reads, and that gap is what this row looks for.
How each browser keeps the two copies together
| Engine | What it does today |
|---|---|
| Chromium | Sends User-Agent, Accept-Language and the low-entropy Sec-CH-UA hints by default. Extensions that change the user agent must change all three and the script values to stay consistent. |
| Firefox | Sends no client hints. privacy.resistFingerprinting changes the header and the script values together, so they stay consistent. |
| Safari | No client hints. The user agent is frozen, and the header and script copies come from one place. |
| Tor Browser | Normalises both copies to the same values for every user of a release. |
How to change your user agent without a mismatch
Change the user agent and languages where the browser keeps them, not in page script: a browser setting, a launch flag, or an engine-level profile changes both copies at once.
Remove extensions that change the user agent by patching `navigator`. They create this contradiction by design.
If a proxy rewrites headers, configure it to leave them alone, or make it change the script side to match, which most cannot.
What the mitigation costs
None, when the change is made at the right layer. An engine-level profile is the only practical way to change the user agent consistently on Chromium.
How to compare your headers with your script values
Nothing below depends on this site. These are the checks that produce the same answer in any browser, so the row above can be argued with rather than believed.
- In the console, compare
navigator.userAgentwith theUser-Agentheader of any request in the network panel. They should be the same string. - Compare
navigator.languageswith theAccept-Languageheader of the same request. The first language should match. - In Chromium, open
navigator.userAgentData.brandsand compare it with theSec-CH-UAheader. A changed user agent with unchanged brands is the commonest mismatch of all.
Header mismatch questions
Asked often enough about this vector to be worth answering on the entry itself.
- Do user-agent switcher extensions work?
- Many change only what script reads, or only the header, and some miss the client hints. Each of those leaves the two copies disagreeing, which is easier to detect than the original user agent was.
- Why does my Accept-Language header differ from navigator.languages?
- Usually because an extension or a script changed the script side, or a proxy rewrote the header. In an unmodified browser both come from the same language setting.
- Does this site store my headers?
- Yes. The request headers are recorded with every page view, as the privacy notice says. Cookies and authorisation headers are not kept.
Entry 16 · schedule edition 1.1.0, effective 2026-10-13, supersedes none. Per-engine notes reviewed 2026-08-12 against documentation for Chromium 141, Firefox 145, Safari 19.2, Tor Browser 14.5; they are compiled from vendor documentation rather than produced by a test run here.