Last active
August 29, 2015 14:26
-
-
Save oleksapro/32754f3f22bc523f93f5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function browser() { | |
var ua = navigator.userAgent; | |
if (ua.search(/MSIE/) != -1) return 'Internet Explorer'; | |
if (ua.search(/Firefox/) != -1) return 'Firefox'; | |
if (ua.search(/Opera/) != -1) return 'Opera'; | |
if (ua.search(/Chrome/) != -1) return 'Google Chrome'; | |
if (ua.search(/Safari/) != -1) return 'Safari'; | |
if (ua.search(/Konqueror/) != -1) return 'Konqueror'; | |
if (ua.search(/Iceweasel/) != -1) return 'Debian Iceweasel'; | |
if (ua.search(/SeaMonkey/) != -1) return 'SeaMonkey'; | |
if (ua.search(/Gecko/) != -1) return 'Gecko'; | |
return 'Search Bot'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment