js浏览器判断
$(function(){
var userAgent = navigator.userAgent;
var systemType = navigator.cpuClass;
var is360 = _mime("type", "application/vnd.chromium.remoting-viewer");
if (isChrome() && is360) { //360浏览器
//alert("检测到是360浏览器");
}else if(!!window.ActiveXObject || "ActiveXObject" in window){//IE浏览器
//alert("ie浏览器");
if(systemType == 'x86'){//IE浏览器32位
//alert("ie32");
}else{//IE浏览器64位
alert("请下载360浏览器");
}
}else{//不是IE也不是360浏览器
alert("请下载360浏览器");
}
optErrMsg();
});
//检测是否是谷歌内核(可排除360及谷歌以外的浏览器)
function isChrome(){
var ua = navigator.userAgent.toLowerCase();
return ua.indexOf("chrome") > 1;
}
//测试mime
function _mime(option, value) {
var mimeTypes = navigator.mimeTypes;
for (var mt in mimeTypes) {
if (mimeTypes[mt][option] == value) {
return true;
}
}
return false;
}

浙公网安备 33010602011771号