Skip to content

Commit 7e4cda1

Browse files
committed
Update client hints warning of secure context requirement
1 parent 1c46a2b commit 7e4cda1

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

docs/api/main/idata/with-client-hints.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,18 @@ Chrome also sends this Client Hints data by default under `Sec-CH-UA-*` HTTP hea
66

77
In browser-environment, obtaining the Client Hints data via JavaScript must be done in an asynchronous way. You can chain the result object from `get*` method with `withClientHints()` to also read the client-hints data from the browser which will return the updated data in a `Promise`.
88

9-
::: info
9+
::: tip
1010
In **Node.js** or in **browser-environment without Client Hints** support (basically anything that's not Chromium-based), `withClientHints()` will return the updated data as a new object instead of as a `Promise`.
1111
:::
1212

13+
::: info
14+
Client Hints are widely supported by most recent Chromium-based browsers (version 85+) such as Chrome, Edge, Opera, etc. While Safari and Firefox doesn't support it due to privacy concerns.
15+
:::
16+
17+
::: warning
18+
Client Hints headers are only available in [**secure contexts**🡭](https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts), such as HTTPS connections (`https://`) and locally-delivered resources (e.g., `http://127.0.0.1`, `http://localhost`, `file://`). If your server doesn't use HTTPS, Client Hints headers won't be sent by the browser and you may not be able to fully utilize the extended capabilities of UAParser.js in parsing Client Hints data.
19+
:::
20+
1321
## Code Example
1422

1523
### Client-side Example

0 commit comments

Comments
 (0)