/ Published in: JavaScript

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function getNameBrouser() { var ua = navigator.userAgent.toLowerCase(); // Определим Internet Explorer if (ua.indexOf("msie") != -1 && ua.indexOf("opera") == -1 && ua.indexOf("webtv") == -1) { return "msie" } // Opera if (ua.indexOf("opera") != -1) { return "opera" } if (ua.indexOf("chrome") != -1) { return "chrome"; } // Gecko = Mozilla + Firefox + Netscape if (ua.indexOf("gecko") != -1) { return "gecko"; } // Safari, иÑпользуетÑÑ Ð² MAC OS if (ua.indexOf("safari") != -1) { return "safari"; } // Konqueror, иÑпользуетÑÑ Ð² UNIX-ÑиÑтемах if (ua.indexOf("konqueror") != -1) { return "konqueror"; } return "unknown"; }
Comments
