WCF
WCF copied to clipboard
Migrate to navigator.userAgentData
In a future version of Chrome, the amount of information available in the User Agent string will be reduced (see https://blog.chromium.org/2021/05/update-on-user-agent-string-reduction.html).
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.
However, the current browser support is very limited, so a fallback solution will be required. Alternatively, there's a small lib that reconstructs the legacy navigator.userAgent string value from the modern navigator.userAgentData values: https://github.com/GoogleChromeLabs/uach-retrofill
More stuff to read: https://github.com/WICG/ua-client-hints
or migrate to navigator.userAgentData. However, the current browser support is very limited, so a fallback solution will be required
And that won't change in the near or mid term. Mozilla changed their assessment last month and now says that the proposal of client hints is harmful for the web:
https://github.com/mozilla/standards-positions/commit/72ea74458a444aa4d2f45aac022b6f4a9e5dbccf
Also Apple's webkit team sees no real advantage over the user agent. The way things currently stand, client hints are just another Chrome-only thing that was made by Google without agreement of other browser vendors. As such it shouldn't be used.
Mozilla changed their position in September 2021, taking a neutral stance as of today. There have been no further indications from the Safari team that anything is planed.
Client hints exist in Chrome for a while now, but I fail to see their benefit. The mobile flag has some optimization potential, but with Safari (and thus everything on iOS/iPadOS) being notably absent, the actual value is quite low. We can already pretty reliably detect browsers based on their behavior.
With the introduction of a new editor we can hopefully abolish UA sniffing entirely, which was pretty much our last use case for navigator.userAgent. And no, feature detection does not help when dealing with the metric ton of bugs in contenteditable…
We’ll revisit UA hints if they are adopted by all major browsers, but for now they are not worth the trouble for us.