You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The **`getHighEntropyValues()`** method of the {{domxref("NavigatorUAData")}} interface is a {{jsxref("Promise")}} that resolves with a dictionary object containing the _high entropy_ values the user-agent returns.
13
+
The **`getHighEntropyValues()`** method of the {{domxref("NavigatorUAData")}} interface returns a {{jsxref("Promise")}} that resolves with a dictionary object containing low entropy information and requested high entropy information about the browser.
14
+
15
+
The resolved object has the ["low entropy" properties](/en-US/docs/Web/API/NavigatorUAData#instance_properties) available on the `NavigatorUAData` object included by default — these are the values that are unlikely to enable fingerprinting of the user.
16
+
It also contains the subset of "high entropy" values requested in the parameter object, and for which permission has been granted.
17
+
These are the values that are more likely to enable fingerprinting.
18
+
Note that meaning of the terms [low entropy](/en-US/docs/Web/HTTP/Guides/Client_hints#low_entropy_hints) and [high entropy](/en-US/docs/Web/HTTP/Guides/Client_hints#high_entropy_hints) is the same as defined in the HTTP [User Agent Client Hints](/en-US/docs/Web/HTTP/Guides/Client_hints) mechanism.
14
19
15
20
> [!NOTE]
16
-
> The terms _high entropy_ and _low entropy_ refer to the amount of information these values reveal about the browser.
17
-
> The values returned as properties are deemed low entropy, and unlikely to identify a user.
18
-
> The values returned by `getHighEntropyValues()` could potentially reveal more information.
19
-
> These values are therefore retrieved via a {{jsxref("Promise")}}, allowing time for the browser to request user permission, or make other checks.
21
+
> Usage of the `getHighEntropyValues()` method to retrieve high-entropy user-agent data can be controlled via the {{HTTPHeader('Permissions-Policy/ch-ua-high-entropy-values', 'ch-ua-high-entropy-values')}} {{HTTPHeader('Permissions-Policy')}}.
22
+
> If the permission is not allowed, the method will only return the `brands`, `mobile`, and `platform` low-entropy data.
20
23
21
24
## Syntax
22
25
@@ -27,7 +30,8 @@ getHighEntropyValues(hints)
27
30
### Parameters
28
31
29
32
-`hints`
30
-
- : An array containing the hints to be returned, one or more of:
33
+
- : An array containing the high-entropy hints to be returned.
34
+
This may include one or more of:
31
35
-`"architecture"`
32
36
-`"bitness"`
33
37
-`"formFactors"`
@@ -39,7 +43,7 @@ getHighEntropyValues(hints)
39
43
40
44
### Return value
41
45
42
-
A {{jsxref("Promise")}} that resolves to an object containing some or all of the following values (based on the hints requested):
46
+
A {{jsxref("Promise")}} that resolves to an object containing some or all of the following values (based on the hints requested and granted):
43
47
44
48
-`brands`
45
49
- : Returns an array of objects containing `brand` and `version` specifying the browser brand and its version (the same information as provided by {{domxref("NavigatorUAData.brands")}}).
Copy file name to clipboardExpand all lines: files/en-us/web/api/navigatoruadata/index.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ The **`NavigatorUAData`** interface of the {{domxref("User-Agent Client Hints AP
14
14
An instance of this object is returned by calling {{domxref("Navigator.userAgentData")}} or {{domxref("WorkerNavigator.userAgentData")}}. Therefore, this interface has no constructor.
15
15
16
16
> [!NOTE]
17
-
> 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 {{domxref("NavigatorUAData.getHighEntropyValues()")}} could potentially reveal more information. These values are therefore retrieved via a {{jsxref("Promise")}}, allowing time for the browser to request user permission, or make other checks.
17
+
> 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](/en-US/docs/Web/HTTP/Guides/Client_hints#low_entropy_hints), which are unlikely to identify a user. The {{domxref("NavigatorUAData.getHighEntropyValues()")}} can be used to request additional [high entropy](/en-US/docs/Web/HTTP/Guides/Client_hints#high_entropy_hints) values, which could potentially reveal more identifying information. These values are therefore retrieved via a {{jsxref("Promise")}}, allowing time for the browser to request user permission, or make other checks.
18
18
19
19
## Instance properties
20
20
@@ -28,7 +28,7 @@ An instance of this object is returned by calling {{domxref("Navigator.userAgent
- : Returns a {{jsxref("Promise")}} that resolves with a dictionary object containing the _high entropy_ values the user-agent returns.
31
+
- : Returns a {{jsxref("Promise")}} that resolves with a dictionary object containing low entropy information and requested high entropy information about the browser.
Copy file name to clipboardExpand all lines: files/en-us/web/api/user-agent_client_hints_api/index.md
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -82,6 +82,29 @@ navigator.userAgentData
82
82
});
83
83
```
84
84
85
+
## Security considerations
86
+
87
+
Websites that support setting a [Permissions Policy](/en-US/docs/Web/HTTP/Guides/Permissions_Policy) (via the HTTP {{HTTPHeader("Permissions-Policy")}} header or the {{HTMLElement("iframe")}} attribute [`allow`](/en-US/docs/Web/HTML/Reference/Elements/iframe#allow)) can restrict the ability to use the User-Agent Client Hints API using the directive {{HTTPHeader("Permissions-Policy/ch-ua-high-entropy-values", "ch-ua-high-entropy-values")}}.
88
+
89
+
Specifically, when the permission is not granted, the {{domxref("NavigatorUAData.getHighEntropyValues()")}} will only return low-entropy data such as `brands`, `mobile`, and `platform`.
90
+
91
+
For example, the following policy would only allow the current origin and two other specific origins to retrieve high-entropy data.
The default allowlist for `ch-ua-high-entropy-values` is `*`, which permits any content within the current document and all nested browsing contexts to use `getHighEntropyValues()`.
104
+
105
+
> [!NOTE]
106
+
> Access to individual high-entropy features can be controlled with their own [individual permissions policies](https://wicg.github.io/client-hints-infrastructure/#policy-controlled-features).
The HTTP {{HTTPHeader("Permissions-Policy")}} header `ch-ua-high-entropy-values` directive controls whether or not the document is permitted to use the {{domxref("NavigatorUAData.getHighEntropyValues()")}} method to retrieve high-entropy user-agent data.
15
+
16
+
If the permission is not allowed, the method will only return the `brands`, `mobile`, and `platform` low-entropy data.
- : A list of origins for which permission is granted to use the feature. See [`Permissions-Policy` > Syntax](/en-US/docs/Web/HTTP/Reference/Headers/Permissions-Policy#syntax) for more details.
26
+
27
+
## Default policy
28
+
29
+
The default allowlist for `ch-ua-high-entropy-values` is `*`.
30
+
31
+
## Examples
32
+
33
+
### Restricting high-entropy data to specific origins
34
+
35
+
The following policy would only allow the current origin and two other specific origins to retrieve high-entropy data.
Copy file name to clipboardExpand all lines: files/en-us/web/http/reference/headers/permissions-policy/index.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -99,6 +99,10 @@ You can specify
99
99
- : Controls whether or not the document is permitted to use the [Captured Surface Control API](/en-US/docs/Web/API/Screen_Capture_API/Captured_Surface_Control).
100
100
The promise returned by the API's main methods will reject with a `NotAllowedError` {{DOMxRef("DOMException")}} if the permission is not allowed.
- : Controls whether or not the document is permitted to use the {{domxref("NavigatorUAData.getHighEntropyValues()")}} method to retrieve high-entropy user-agent data.
104
+
If the permission is not allowed, the method will only return the `brands`, `mobile`, and `platform` low-entropy data.
0 commit comments