Since Google Chrome 71, using !!window.chrome && !!window.chrome.webstore;
to detect Google Chrome in javascript doesn't work anymore. It's pretty recent so I don't seem to find a good replacement yet.
Anybody know a good way to detect Google Chrome without window.chrome.webstore
? Or are we stuck using navigator.userAgent.indexOf("Chrome") !== -1
in the meantime?
Thanks!
To detect user browser information we use the navigator. userAgent property. And then we match with the browser name to identify the user browser. Now call this JS function on page load, and this will display the user browser name on page load.
To check if browser is Google Chrome: var isChrome = navigator. userAgent. includes("Chrome") && navigator.
You can use the navigator. appName and navigator. userAgent properties. The userAgent property is more reliable than appName because, for example, Firefox (and some other browsers) may return the string "Netscape" as the value of navigator.
To enable these settings, enter chrome://flags in Chrome's address bar. Then scroll down until you find these two settings: Touch Optimized UI and Enable touch events. Use the drop-down boxes to enable both.
You should try this:
var isChrome = /Google Inc/.test(navigator.vendor);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With