Skip to content

Instantly share code, notes, and snippets.

@appden
Created August 6, 2009 18:00
Show Gist options
  • Select an option

  • Save appden/163468 to your computer and use it in GitHub Desktop.

Select an option

Save appden/163468 to your computer and use it in GitHub Desktop.
// add chrome to jQuery browser test
if ((jQuery.browser.chrome = /chrome/i.test(navigator.userAgent))
jQuery.browser.version = navigator.userAgent.match(/chrome\/(\d+)/i)[1];
// alternative I just thought of...
if (/chrome\/(\d+)/i.exec(navigator.userAgent)){
jQuery.browser.chrome = true;
jQuery.browser.version = RegExp.$1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment