Reputation: 335
I use javascript method navigator.userAgent to detect version of browser. But it gives wrong version for Chrome.
My Chrome is 114.0.5735.134, but the navigator.userAgent show it is 114.0.0.0.
I would be grateful if some body can give me advice on how to fix this? Thank you.
Upvotes: -1
Views: 868
Reputation: 1
To use find-chrome-version
:
import findChromeVersion from "find-chrome-version"
const example = async () => {
const chromeVersion = await findChromeVersion()
console.log(`Your Chrome version is ${chromeVersion}`)
}
Upvotes: -2
Reputation: 335
At least for Chrome, there's library name: find-chrome-version. This would give you the exact version of Chrome. https://www.npmjs.com/package/find-chrome-version
Upvotes: -1