Jump to content

Check if browser is chrome?


Recommended Posts

I need help. I would like to have a script that would detect if the browser used is chrome. If browser is chrome then show div.

 

This is the script i have now!

<script>
var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome');
if (is_chrome > 1) {
alert('Best viewed in Google Chrome!')
}
else{
alert('Best viewed in Google Chrome')
}
</script>

Link to comment
https://forums.phpfreaks.com/topic/235763-check-if-browser-is-chrome/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.