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("該值注冊(cè)表中已存在");
} catch (e) {
alert("注冊(cè)表中不存在該值");
}
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.