ua-parser-js
ua-parser-js copied to clipboard
Chrome 93.0 says that CHANGE WILL COME
Here is what the Chrome console recently started saying,
Now the question is,
Should we be alarmed? Will our good apps still work then?
Generally the useragent will and is already less relevant. Feature detection is the right solution and there is also a new feature called Client Hints. Chrome and other browsers will reduce the information in the useragent string and this will be frozen then.
Parsing useragent strings in general is not a good solution (and often you can cause vulnerabilities with special strings and they are also often spoofed).
https://css-tricks.com/freezing-user-agent-strings/
https://medium.com/@galmeiri/get-ready-for-chrome-user-agent-string-phase-out-c6840da1c31e
https://www.chromestatus.com/feature/5704553745874944
Feature detection is the right solution
Feature detection is impossible in too many cases (for example, bug fixes of async features).
Feature detection is harmful in some cases (for example, some cases of feature detection in Chrome even without polyfilling cause ~100x slowdown).
is also a new feature called Client Hints
Is anyone else experiencing an issue where the user agent in Chrome 95 is parsed incorrectly when using the Chrome emulator to emulate mobile devices?
I'm getting a desktop user agent on initial render of my app and then when I refresh the page I get the correct user agent parsed.
I've been trying to work out the cause for the last week or so, and I believe that the problems align with the release of Chrome 95.
I guess since it will take quite some time until all up to date browsers have implemented it, and ua-parser-js is also used to detect outdated browsers, it will still be helpful for quite some time.
Could it make sense to rely on the new client hint APIs when they are available and fall back to the existing UA parsing? so the API for devs doesn't change?
PS: totally willing to contribute to that.
Moving user agent client hints-related issue here: #408