ua-parser-js icon indicating copy to clipboard operation
ua-parser-js copied to clipboard

Chrome 93.0 says that CHANGE WILL COME

Open The-Linguist opened this issue 2 years ago • 5 comments

Here is what the Chrome console recently started saying,

console

Now the question is,

Should we be alarmed? Will our good apps still work then?

The-Linguist avatar Sep 30 '21 22:09 The-Linguist

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

DanielRuf avatar Oct 24 '21 07:10 DanielRuf

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

That makes impossible proper polyfill as a service or other cases of code generation for a specific browser.

zloirock avatar Oct 24 '21 13:10 zloirock

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.

Sillhouette avatar Oct 28 '21 17:10 Sillhouette

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.

karfau avatar Nov 05 '21 11:11 karfau

Moving user agent client hints-related issue here: #408

faisalman avatar Mar 21 '23 04:03 faisalman