Last active
August 29, 2015 14:08
-
-
Save raym/70f2c6af4bd91cb9fb72 to your computer and use it in GitHub Desktop.
Browser detection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var | |
is_chrome = navigator.userAgent.indexOf('Chrome') > -1, | |
is_safari = navigator.userAgent.indexOf("Safari") > -1 && !is_chrome, | |
is_firefox = navigator.userAgent.indexOf('Firefox') > -1, | |
is_explorer = (navigator.userAgent.indexOf('MSIE') !== -1 || navigator.appVersion.indexOf('Trident/') > 0), | |
is_opera = navigator.userAgent.indexOf("Presto") > -1 | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment