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

use the new navigator.userAgentData with fallback to navigator.userAgent

Open Erdragh opened this issue 1 year ago • 0 comments

Chromium and userAgent

As it seems, Chromium and by extension Chrome, Edge, Brave, Opera, etc. will deprecate userAgent in the near future.

Replacement / new Solution

The new replacement for this will be navigator.userAgentData.

Here are the docs on userAgentData, which is still experimental and not supported by Firefox. As such userAgent should still be used as a fallback, as described here:

https://web.dev/migrate-to-ua-ch/

Erdragh avatar Jul 26 '22 07:07 Erdragh