search

Home  >  Q&A  >  body text

chrome - How to read registry values ​​with JavaScript

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?

世界只因有你世界只因有你2778 days ago1590

reply all(1)I'll reply

  • 高洛峰

    高洛峰2017-05-19 10:31:20

    The ActiveXObject plug-in is unique to IE and cannot be used universally under different browser cores.

    reply
    0
  • Cancelreply