-3

i'm building a quick prototype and i did optimize it only for Chrome. I'd like to detect all the browser, but chrome, so i can display an alert message about performance etc..

what's the best way to achieve this?

Francesco
  • 24,088
  • 27
  • 100
  • 147

1 Answers1

1

Use

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

Then you can have an alert

if(!is_chrome){
    //display an alert
}

Source: this question

Community
  • 1
  • 1
cppprog
  • 794
  • 3
  • 10
  • 21