Skip to content

Instantly share code, notes, and snippets.

@rkotze
Created February 20, 2019 10:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rkotze/110acc224810d0a570a1cea3fa2c740f to your computer and use it in GitHub Desktop.
Save rkotze/110acc224810d0a570a1cea3fa2c740f to your computer and use it in GitHub Desktop.
Detect if Google Chrome and return version number
function detectChromeVersion() {
var chrome = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);
if(chrome) return parseInt(chrome[2], 10);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment