function BrowserIdentification() {
var Browser;
var isOpera = !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;
// Opera 8.0+ (UA detection to detect Blink/v8-powered Opera)
var isFirefox = typeof InstallTrigger !== 'undefined'; // Firefox 1.0+
var isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0;
// At least Safari 3+: "[object HTMLElementConstructor]"
var isChrome = !!window.chrome && !isOpera; // Chrome 1+
var isIE = /*@cc_on!@*/false || !!document.documentMode; // At least IE6
if (isOpera) {
Browser = "opera";
}
else if (isFirefox) {
Browser = "firefox";
}
else if (isSafari) {
Browser = "safari";
}
else if (isChrome) {
Browser = "chrome";
}
else if (isIE) {
Browser = "ie";
}
return Browser;
}
var Browser;
var isOpera = !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;
// Opera 8.0+ (UA detection to detect Blink/v8-powered Opera)
var isFirefox = typeof InstallTrigger !== 'undefined'; // Firefox 1.0+
var isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0;
// At least Safari 3+: "[object HTMLElementConstructor]"
var isChrome = !!window.chrome && !isOpera; // Chrome 1+
var isIE = /*@cc_on!@*/false || !!document.documentMode; // At least IE6
if (isOpera) {
Browser = "opera";
}
else if (isFirefox) {
Browser = "firefox";
}
else if (isSafari) {
Browser = "safari";
}
else if (isChrome) {
Browser = "chrome";
}
else if (isIE) {
Browser = "ie";
}
return Browser;
}
No comments:
Post a Comment