dom / latest / navigatoruadata / gethighentropyvalues.html /

NavigatorUAData.getHighEntropyValues()

The getHighEntropyValues() method of the NavigatorUAData interface is a Promise that resolves with a dictionary object containing the high entropy values the user-agent returns.

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, and unlikely to identify a user. The values returned by NavigatorUAData.getHighEntropyValues() could potentially reveal more information. These values are therefore retrieved via a Promise, allowing time for the browser to request user permission, or make other checks.

Syntax

getHighEntropyValues(hints)

Parameters

hints

An array containing the hints to be returned, one or more of:

  • "architecture"
  • "bitness"
  • "model"
  • "platformVersion"
  • "uaFullVersion" Deprecated
  • "fullVersionList"

Return value

A Promise that resolves to an object containing some or all of the following values (based on the hints requested):

architecture

A string containing the platform architecture. For example, "x86".

bitness

A string containing the architecture bitness. For example, "64".

model

A string containing the device model. For example, "Pixel 2XL".

platformVersion

A string containing the platform version. For example, "10.0".

uaFullVersion Deprecated

A string containing the full browser version. For example, "91.0.4472.124".

fullVersionList

An array of brand information containing the browser name and full version. For example, "Chromium";v="91.0.4472.124","Google Chrome";v="91.0.4472.124".

Exceptions

NotAllowedError DOMException

Thrown if the user-agent decides that one or more of the hints requested should not be returned.

Examples

In the following example 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",
  "platformVersion",
  "fullVersionList"])
  .then(ua => { console.log(ua) });

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
getHighEntropyValues
90
90
No
No
76
No
No
90
No
64
No
15.0

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/NavigatorUAData/getHighEntropyValues