WICG / ua-client-hints

Wouldn't it be nice if `User-Agent` was a (set of) client hints?
https://wicg.github.io/ua-client-hints/
Other
591 stars 77 forks source link

navigator.userAgentData.getHighEntropyValues is not working on Chrome on iPhone #367

Closed pm-harshad-mane closed 5 months ago

pm-harshad-mane commented 5 months ago

Description

Here is demo page provided by Chrome Team, https://user-agent-client-hints.glitch.me/ on the page https://developer.chrome.com/docs/privacy-security/user-agent-client-hints

On Desktop, you can see navigator.userAgentData.getHighEntropyValues returns the data but it does not return any data on Chrome on iPhone.

Prebid relies on this API to populate device details https://github.com/search?q=repo%3Aprebid%2FPrebid.js%20getHighEntropyValues&type=code

Am I missing something?

Steps to reproduce

Visit https://user-agent-client-hints.glitch.me/ on Dsktop and mobile devices.

Test page

https://user-agent-client-hints.glitch.me/

Expected results

The API should return data on both Desktop and mobile devices.

Platform details

Tested on iPhone 14, Chrome 126

arichiv commented 5 months ago

As Chrome for iOS uses WebView, I don't believe it supports any JavaScript APIs not part of Safari on iOS: https://developer.mozilla.org/en-US/docs/Web/API/NavigatorUAData/getHighEntropyValues

pm-harshad-mane commented 5 months ago

Thanks @arichiv for a quick response ohh.. it is not clear from the Browser Compatibility Table https://developer.mozilla.org/en-US/docs/Web/API/NavigatorUAData/getHighEntropyValues#browser_compatibility Another column as "Chrome on iOS" will be helpful

arichiv commented 5 months ago

The only iOS browser listed is Safari as, except for https://developer.apple.com/support/alternative-browser-engines/, the rest all must use WebView AFAIK

pm-harshad-mane commented 5 months ago

Thanks @arichiv !