1

My current web page only displays properly in google chrome. Therefore, I would like to make browsers other than google chrome display a pop up that says "please use google chrome".

Currently I am using

alert("Please use Google Chrome");

but the problem here is that it also displays that alert in google chrome. Is there any way to display this alert in specific browsers only?

Blaine
  • 332
  • 1
  • 4
  • 18

1 Answers1

2
var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;

This checks if the browser is chrome so now what you can do:

if (is_chrome != true) {alert("Please use Google Chrome")}

or

if (is_chrome != true) {prompt("Please use Google Chrome Download it here:", "https://www.google.com/chrome/browser/index.html")}