Xerobit
Dev Productivity

navigator.userAgentData Is Undefined: Client Hints Support and Fallbacks

Why navigator.userAgentData is undefined (Firefox, Safari, insecure pages), tested getHighEntropyValues output, Accept-CH, Critical-CH and Vary in Chrome 156, and a fallback.

MA Mian Ali Khalid Updated Nov 2, 2026 7 min read
Free tool
User Agent Parser
Parse any User-Agent string into browser, OS, device, and engine. Or detect your own. Built on the maintained ua-parser-js dataset.
Open tool →
On this page ⌄
  1. Why it is undefined
  2. What it returns in Chrome 156 (Windows)
  3. The HTTP side
  4. A fallback that works
  5. When you only need to decode a string
  6. Tested

navigator.userAgentData is undefined in three situations: the browser does not implement it, the page is not a secure context, or the browser is old. This guide shows the first two with measurements from Chrome 156, then the real output of getHighEntropyValues, what the HTTP side (Accept-CH, Critical-CH, Vary) does on the wire, and a fallback that works everywhere. Everything was run on 2026-11-02.

Why it is undefined

1. The browser does not implement it. MDN's browser-compat data for NavigatorUAData lists Chrome 90 and Samsung Internet 23 as the first versions with support, with Edge and Opera mirroring Chrome, and false for Firefox and Safari (desktop and iOS follow the same data: the iOS entry mirrors Safari). So on those browsers the property does not exist, and code like navigator.userAgentData.brands throws TypeError.

2. The page is not a secure context. The same page was loaded from http://localhost (treated as secure) and from http://insecure.test, a hostname mapped to 127.0.0.1 so it is plain HTTP on a non-local name:

PageisSecureContexttypeof navigator.userAgentDataDefault Sec-CH-UA* request headers
http://localhost:PORT/trueobjectsec-ch-ua, sec-ch-ua-mobile, sec-ch-ua-platform
http://insecure.test:PORT/falseundefinednone

So testing on a non-localhost HTTP address fails in Chrome, in both the JavaScript API and the headers. Serve over HTTPS.

What it returns in Chrome 156 (Windows)

const u = navigator.userAgentData;
u.brands;     // [{brand:'Not:A-Brand',version:'8'},{brand:'Chromium',version:'156'},{brand:'Google Chrome',version:'156'}]
u.mobile;     // false
u.platform;   // 'Windows'

await u.getHighEntropyValues(['architecture','bitness','model','platformVersion','fullVersionList','wow64']);
// {
//   architecture: 'x86', bitness: '64', model: '', platform: 'Windows', platformVersion: '19.0.0', wow64: false, mobile: false,
//   brands: [...same as above...],
//   fullVersionList: [{brand:'Not:A-Brand',version:'8.0.0.0'},{brand:'Chromium',version:'156.0.8078.48'},{brand:'Google Chrome',version:'156.0.8078.48'}]
// }

Notes from the output:

  • The brand list includes a deliberately meaningless entry (Not:A-Brand) whose name and position change over time. Do not read brands[0] as the browser name,. Search the array for the brand you care about (Google Chrome, Microsoft Edge) and ignore Chromium unless you only need the engine.
  • model is an empty string on desktop.
  • platformVersion on this Windows machine is '19.0.0'; it is not the same as the Windows marketing name, so map it with a table.
  • Low-entropy values (brands, mobile, platform) are available synchronously, and toJSON() returned just those three. The other values need the Promise and are subject to the browser's decision about releasing them (Chrome applies a ch-ua-high-entropy-values permissions policy from version 144, per MDN).
  • The classic navigator.userAgent in the same browser was Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/156.0.0.0 Safari/537.36: the Windows version is frozen at 10.0 and the Chrome minor/patch parts are zeros. That is the "UA reduction" that makes the hints necessary.

The HTTP side

Per MDN, Save-Data, Sec-CH-UA, Sec-CH-UA-Mobile and Sec-CH-UA-Platform are low-entropy hints that may be sent by default. Everything else must be requested. A Node server and Chrome 156 show it:

Accept-CH. The first response carried Accept-CH: Sec-CH-UA-Platform-Version, Sec-CH-UA-Arch, Sec-CH-UA-Bitness. The first request had only the three default headers. The second request to the same origin added:

sec-ch-ua-arch: "x86"
sec-ch-ua-platform-version: "19.0.0"
sec-ch-ua-bitness: "64"

So with Accept-CH alone the first page view never has the hints.

Critical-CH. With Critical-CH: Sec-CH-UA-Platform-Version (plus the same name in Accept-CH), one navigation caused two requests to the server: the first without the hint, the second, sent automatically by the browser, with sec-ch-ua-platform-version. MDN: the browser "will retry the request rather than render the page". Use it only when the first response would be wrong without the hint, since it costs a round trip.

Vary. MDN says that hints which change the response should be listed in Vary, so caches keep one copy per value: Vary: Sec-CH-UA-Platform-Version. The test server sets it; cache behaviour was not tested.

Express:

app.use((req, res, next) => {
  res.set('Accept-CH', 'Sec-CH-UA-Platform-Version, Sec-CH-UA-Arch');
  res.vary('Sec-CH-UA-Platform-Version');   // only if the response depends on it
  next();
});

A fallback that works

async function getPlatformInfo() {
  const uad = navigator.userAgentData;
  if (uad) {
    const hi = await uad.getHighEntropyValues(['platformVersion', 'architecture']).catch(() => ({}));
    return { source: 'userAgentData', mobile: uad.mobile, platform: uad.platform,
             platformVersion: hi.platformVersion, architecture: hi.architecture };
  }
  const ua = navigator.userAgent;
  return { source: 'userAgent', mobile: /Mobi|Android/i.test(ua),
           platform: /Windows/.test(ua) ? 'Windows' : /Android/.test(ua) ? 'Android'
                   : /iPhone|iPad/.test(ua) ? 'iOS' : /Mac/.test(ua) ? 'macOS'
                   : /Linux/.test(ua) ? 'Linux' : 'Unknown' };
}

In Chrome 156 on localhost it returned {source:'userAgentData', mobile:false, platform:'Windows', platformVersion:'19.0.0', architecture:'x86'}; on the plain-HTTP page it fell back to {source:'userAgent', mobile:false, platform:'Windows'}. The .catch matters because getHighEntropyValues can reject when the browser or policy refuses. The order of tests in the fallback matters too: iOS user agents contain "Mac OS X", and Android ones contain "Linux", which is why iPhone and Android are tested first.

Firefox and Safari were not run, so the fallback branch was exercised through the insecure-page case, not on those browsers.

When you only need to decode a string

For logs and bug reports you still have User-Agent strings. The User Agent Parser turns one into browser, engine, OS and device. Its bot flag is a keyword match; to confirm a crawler is genuine, see how to verify Googlebot.

Prefer feature detection ('serviceWorker' in navigator, CSS.supports(...)) over any form of browser sniffing when the goal is "does this API exist", since that is what actually decides behaviour.

Tested

2026-11-02: Chrome 156.0.8078.48 (headless) via playwright-core against a local Node 25.8 server; insecure.test mapped to 127.0.0.1 with --host-resolver-rules. Browser support from MDN's browser-compat-data (NavigatorUAData.json) and the MDN Client hints guide. Firefox and Safari were not run.

Keep reading

Related tools

Written by Mian Ali Khalid. More guides in Dev Productivity.