Skip to content

Instantly share code, notes, and snippets.

@jerkovicl
Last active August 29, 2015 14:15
Show Gist options
  • Select an option

  • Save jerkovicl/82f2ac3f92911fbd3a24 to your computer and use it in GitHub Desktop.

Select an option

Save jerkovicl/82f2ac3f92911fbd3a24 to your computer and use it in GitHub Desktop.
user agent
// See also: https://github.com/azer/environ
//http://nextmarvel.net/blog/2011/02/one-line-javascript-browser-detection/
var IE6 = /msie 6/i.test(navigator.userAgent),
IE7 = /msie 7/i.test(navigator.userAgent),
IE8 = /msie 8/i.test(navigator.userAgent),
IE9 = /msie 9/i.test(navigator.userAgent),
IE10 = /msie 9/i.test(navigator.userAgent),
SAFARI = /safari/i.test(navigator.userAgent),
FIREFOX = /firefox/i.test(navigator.userAgent),
CHROME = /chrome/i.test(navigator.userAgent),
IPHONE = /iphone/i.test(navigator.userAgent),
MAC = /mac/i.test(navigator.userAgent),
WINDOWS = /win/i.test(navigator.appVersion),
LINUX = /linux/i.test(navigator.appVersion),
UNIX = /X11/i.test(navigator.appVersion),
KINDLE = /kindle/i.test(navigator.userAgent);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment