Detecting Google Chrome | JavaScriptSource

Detecting Google Chrome

David Walsh Sep 5, 2008

General

Need to check Google's new browser to see if it has a quirk that none of the other browsers have? You can detect Chrome by using this snippet in your scripts.


Notes

Source Code

Paste this source code into the designated areas.

Head

Paste this code into your script.


Leave a Response

(1 comment)

You have to change the Safari detection as well. The word Safari and Chrome are both in the user agent string.[br /]Something like this:[br /][br /]var is_safari = navigator.userAgent.toLowerCase().indexOf('chrome') == -1 && navigator.userAgent.toLowerCase().indexOf('safari') > -1;

Eric Wagener Sep 7, 2008