ua-parser-js
ua-parser-js copied to clipboard
use the new navigator.userAgentData with fallback to navigator.userAgent
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/