问:网站中使用了第三方协议。当您单击链接时,将打开一个第三方程序,但前提是该程序安装在用户的PC上。
如果未安装,则没有提示。现在需要进行测试。
目前,可行的方法是在“是”中读取特定的注册表值IE,代码如下(WarnOnOpen出于测试目的:
try {
var shell = new ActiveXObject("WScript.Shell");
var ChatCallerKey=shell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\ProtocolExecute\WPC\WarnOnOpen");
Alert ("the value already exists in the registry");
} catch (e) {
Alert ("the value does not exist in the registry");
}
但是在Chrome和Firefox中国发生了什么?
还是有其他方法可以做到这一点?
答:Activexobject插件是IE独有的,不能在不同的浏览器内核中使用。