不是的。navigator.appName并不是内核名,在IE中为“MicroSoft Internet Explorer”,其他浏览器遵循W3C,值为“Netscape”,这个值是W3C规定的,或许是为了纪念网景吧。并不是因为chrome的问题,Firefox也是.本人Windows8.1下的IE11(IE11已经遵循W3C规范了)下获得的appName也是“Netscape”.
function checkIs360(){ var is360 = false; var isIE = false; if (window.navigator.appName.indexOf("Microsoft") != -1){ isIE= true; } if(isIE&&(window.navigator.userProfile+'')=='null'){ is360 = true; } if(is360)return true; else return false; } 判断是否为360浏览器
你可以把你这个html放chrome下执行看看显示的也是这样的。
var is360 = false;
var isIE = false;
if (window.navigator.appName.indexOf("Microsoft") != -1){
isIE= true;
}
if(isIE&&(window.navigator.userProfile+'')=='null'){
is360 = true;
}
if(is360)return true;
else return false;
}
判断是否为360浏览器
IE8即以下版本也会返回true