Firefox Tomorrow

web api interface

NavigatorUAData

View on MDN ↗

Limited availabilityAvailable in workers

The NavigatorUAData interface of the User-Agent Client Hints API returns information about the browser and operating system of a user.

An instance of this object is returned by calling userAgentData or userAgentData. Therefore, this interface has no constructor.

[!NOTE] The terms high entropy and low entropy refer to the amount of information these values reveal about the browser. The values returned as properties are deemed low entropy, which are unlikely to identify a user. The getHighEntropyValues() can be used to request additional high entropy values, which could potentially reveal more identifying information. These values are therefore retrieved via a Promise, allowing time for the browser to request user permission, or make other checks.

Instance properties

  • brands Read only Experimental
    • : Returns an array of brand information containing the browser name and version.
  • mobile Read only Experimental
    • : Returns true if the user-agent is running on a mobile device.
  • platform Read only Experimental
    • : Returns the platform brand the user-agent is running on.

Instance methods

  • getHighEntropyValues() Experimental
    • : Returns a Promise that resolves with a dictionary object containing low entropy information and requested high entropy information about the browser.
  • toJSON() Experimental
    • : A serializer that returns a JSON representation of the low entropy properties of the NavigatorUAData object.

Examples

Getting the brands

The following example prints the value of brands to the console.

console.log(navigator.userAgentData.brands);

Returning high entropy values

In the following value a number of hints are requested using the getHighEntropyValues() method. When the promise resolves, this information is printed to the console.

navigator.userAgentData
  .getHighEntropyValues([
    "architecture",
    "model",
    "platform",
    "platformVersion",
    "fullVersionList",
  ])
  .then((ua) => {
    console.log(ua);
  });

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also