Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New User-Agent Client Hints #408

Closed
zxlin opened this issue Jan 15, 2020 · 13 comments
Closed

New User-Agent Client Hints #408

zxlin opened this issue Jan 15, 2020 · 13 comments

Comments

@zxlin
Copy link

zxlin commented Jan 15, 2020

W3C has put out a draft for new user-agent hints: https://wicg.github.io/ua-client-hints/

Also reference: https://tools.ietf.org/html/draft-west-ua-client-hints-00

Is there a plan to support these in the upcoming months? It looks like Chrome is going to freeze User-Agent strings this year.

  • Chrome 81 (mid-March 2020) - Google plans to show warnings in the Chrome console for web pages that read the UA string, so developers can adjust their website code.
  • Chrome 83 (early June 2020) - Google will freeze the Chrome browser version in the UA string and unify OS versions
  • Chrome 85 (mid-September 2020) - Google will unify the UA desktop OS string as a common value for desktop browsers. Google will also unify mobile OS/device strings as a similarly common value.

https://www.zdnet.com/article/google-to-phase-out-user-agent-strings-in-chrome/

@azu
Copy link

azu commented Mar 16, 2020

User-Agent Client Hints spec define HTTP request header and JavaScript DOM API.
Latest spec and Chrome 82+(canary) remove navigation.getUserAgent() JavaScript API and introduce navigation.userAgentData object.

NavigatorUAData return low entropy values synchronously,
On the one hand, NavigatorUAData return high entropy values asynchronously.

// Low Entropy Values
console.log(navigator.userAgentData.mobile); // false
copy(navigator.userAgentData.uaList); // [{ "brand": "Google Chrome", "version": "82" }]

// High Entropy Values
navigator.userAgentData.getHighEntropyValues(["platform", "platformVersion", "architecture", "model"]).then(res => console.log(res)); 
/* {architecture: "Intel", model: "", platform: "Mac OS X", platformVersion: "10_15_3", uaFullVersion: ""} */

Refs:

@ghost
Copy link

ghost commented Mar 27, 2020

@faisalman any plan to incorporate this into the lib?

@pardoman
Copy link

pardoman commented Dec 3, 2020

^ Ditto

@jpodwys
Copy link

jpodwys commented Apr 1, 2021

As of Feb 24 2021, this is the status of Chrome freezing the UA string

No, the UA string will not be frozen in Chrome 89. We've yet to release a firm timeline.

@sandrolain
Copy link

Hello,
the Blink / Chromium team has recently released an official communication with timeline details on the reduction of the User-Agent:

@beatrizz
Copy link

I'd also be interested in this. Are there any plans to add support?

@UCS-Kris
Copy link

UCS-Kris commented Nov 9, 2021

Chrome now reports

A page or script is accessing at least one of navigator.userAgent, navigator.appVersion, and navigator.platform. Starting in Chrome 101, the amount of information available in the User Agent string will be reduced.

To fix this issue, replace the usage of navigator.userAgent, navigator.appVersion, and navigator.platform with feature detection, progressive enhancement, or migrate to navigator.userAgentData.

Note that for performance reasons, only the first access to one of the properties is shown

@szbotms
Copy link

szbotms commented Nov 17, 2021

Is there any support planned? UA strings are the same now with Chrome 95+ between Windows 10 and 11 and between MacOS 10, 11 and 12.

@kozmanbalint
Copy link

+1 on this

@tiamed
Copy link

tiamed commented Dec 1, 2022

Screenshot_2022-12-01-14-01-50-888_com chrome can

Already taken affect on Chrome 110

@munepom
Copy link

munepom commented Dec 8, 2022

+1 on this 👍

@victorresola
Copy link

+1 on this too

@faisalman
Copy link
Owner

Starting from version 2.0, user-agent client hints can be used as an addition to existing user-agent by explicitly calls withClientHints() method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests