Skip to content

Instantly share code, notes, and snippets.

@edysegura
Last active September 16, 2015 23:03
Show Gist options
  • Save edysegura/2e1474711e355da318af to your computer and use it in GitHub Desktop.
Save edysegura/2e1474711e355da318af to your computer and use it in GitHub Desktop.
[JS] Browser Detection
var result = navigator.userAgent.match(/(opera|chrome|safari|firefox|msie|trident)\/?\s*(\.?\d+(\.\d+)*)/i);
//output: ["Chrome/41.0.2272.76", "Chrome", "41.0.2272.76", ".76"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment