Example 1 — Read brands
MDN’s beginner check: print the brand list when Client Hints exist.
if (!navigator.userAgentData) {
console.log("userAgentData unavailable");
} else {
console.log(navigator.userAgentData.brands);
} How It Works
- Detect first. Safari / Firefox typically omit the property.
- Read
brands. An array of{ brand, version }objects (low entropy). - GREASE brands. Lists may include intentional nonsense brands for anti-sniffing — do not hard-code one name.
- No network call. This property is synchronous once the object exists.

