UA-CH JS x-origin iframe

This demo shows the use of the navigator.userAgentData JavaScript API within a cross-originiframe.

Specifically, the JavaScript API is NOT affected by setting Permissions Policy headers. These will prevent the browser sending the Sec-CH-UA headers, but the information can still be accessed in JavaScript.

This top-level page response sends the following headers:

Permissions-Policy: ch-ua=(), ch-ua-platform=(), ch-ua-platform-version=(), ch-ua-full-version=(self "https://rowan.fyi/made/user-agent-client-hints")
Accept-CH: Sec-CH-UA-Full-Version

This is explicitly disallowing the default Sec-CH-UA and Sec-CH-UA-Platform hints while allowing and requesting the additional Sec-CH-UA-Full-Version hint. Use of the hint is also delegated to the cross-origin site.

Open up DevTools in Chrome and you can verify that the request for the iframe does not include the default headers and does include the full version.