mercredi 21 février 2018

Alert when page opened not in Chrome

I'm trying to get an alert to pop up when the user opens my webpage in a browser other than Chrome. I have this:

if (/what to put here to make the below show only if the browser is not Google Chrome?/) { alert( "Please use Google Chrome to access this site.\nSome key features do not work in browsers other than Chrome." ); }

Found this here as a possible condition: navigator.userAgent.search("Chrome"), but can't make it work. Please advise. :-)

Aucun commentaire:

Enregistrer un commentaire