Skip to content

Instantly share code, notes, and snippets.

@Riveascore
Last active August 29, 2015 13:57
Show Gist options
  • Save Riveascore/9838160 to your computer and use it in GitHub Desktop.
Save Riveascore/9838160 to your computer and use it in GitHub Desktop.
window.detect_browser = function() {
window.is_chrome = navigator.userAgent.indexOf('Chrome') > -1;
window.is_explorer = navigator.userAgent.indexOf('MSIE') > -1;
window.is_firefox = navigator.userAgent.indexOf('Firefox') > -1;
window.is_safari = navigator.userAgent.indexOf("Safari") > -1;
window.is_Opera = navigator.userAgent.indexOf("Presto") > -1;
if ((window.is_chrome)&&(window.is_safari)) {window.is_safari=false;}
}
if(window.is_chrome || window.is_safari) {
}
else if(window.is_firefox) {
}
else if(window.is_Opera) {
}
else if(window.is_explorer) {
}
else {
// Baylife
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment