Skip to content

Instantly share code, notes, and snippets.

@jeffreynolte
Created September 16, 2014 22:17
Show Gist options
  • Save jeffreynolte/034d5c81379b04e87c0f to your computer and use it in GitHub Desktop.
Save jeffreynolte/034d5c81379b04e87c0f to your computer and use it in GitHub Desktop.
JS Browser Detection
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