我想知道为什么不netscape
使用JS
if(navigator.appName == "Netscape" && parseInt(navigator.appVersion.charAt(0)) >= 4){
//netscape should work, but the code doesn't work and I get an error in the console
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserWrite");
//uncaught ReferenceError: netscape is not defined
window.open(
"URL",
"Name",
"menubar=off, toolbar=off, location=off, personalbar=off, status=off, minimizable=off, resizable=off, directories=off, chrome=on, dialog=off, titlebar=no, alwaysRaised=on, close=no"
);
}else{
alert('Your browser isn\'t supported!');
}
与 Netscape 一起使用的所有浏览器(如 Chrome、Firefox、Opera...)都返回此错误
注意错误是: uncaught ReferenceError: netscape is not defined
对于那些不知道什么是 Netscape 的人,请阅读以下问题的答案:
为什么 JavaScript navigator.appName 为 Safari、Firefox 和 Chrome 返回 Netscape?
编辑:
新问题,如何在 Chrome、Firefox、Opera 中获得UniversalBrowserWrite 权限?