The web site uses a third-party protocol. When clicking the link, a third-party program will be opened, but only if the program is installed on the user's PC.
If it is not installed, there will be no prompt. Need to test now.
The currently feasible method is to read specific registry values, which is possible in IE
. The code is as follows (WarnOnOpen
is for testing):
try {
var shell = new ActiveXObject("WScript.Shell");
var ChatCallerKey=shell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\ProtocolExecute\WPC\WarnOnOpen");
alert("该值注册表中已存在");
} catch (e) {
alert("注册表中不存在该值");
}
But what to do in Chrome
and Firefox
?
Or is there any other way to do this kind of detection?
The ActiveXObject plug-in is unique to IE and cannot be used universally under different browser cores.