lalatir
lalatir

Reputation: 69

Google Chrome 71 detection in Javascript

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!

Upvotes: 6

Views: 1030

Answers (1)

leylek
leylek

Reputation: 19

You should try this:

var isChrome = /Google Inc/.test(navigator.vendor);

Upvotes: 1

Related Questions