Created
September 16, 2014 22:17
-
-
Save jeffreynolte/034d5c81379b04e87c0f to your computer and use it in GitHub Desktop.
JS 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 detectedUA = jQuery(document).browserDetection(); | |
var is_explorer = navigator.userAgent.indexOf('MSIE') > -1; | |
var is_firefox = navigator.userAgent.indexOf('Firefox') > -1; | |
var is_Opera = navigator.userAgent.indexOf("Presto") > -1; | |
var is_chrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor); | |
var is_safari = /Safari/.test(navigator.userAgent) && /Apple Computer/.test(navigator.vendor); | |
var is_windowsphone = /Windows Phone/.test(navigator.userAgent); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment