windows下浏览器调用原生app

regist.reg

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\protocolName]
@="protocolName Protocol"
"URL Protocol"=""

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\protocolName\DefaultIcon]
@="C:\\Program Files (x86)\\AppPath\\AppName.exe"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\protocolName\shell]
@=""

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\protocolName\shell\open]
@=""

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\protocolName\shell\open\command]
@="\"C:\\Program Files (x86)\\AppPath\\AppName.exe\" \"%1\""

test.html

<!DOCTYPE html>
<html>
<head>
    <title>Open App</title>
</head>
<body>
    <a href="protocolName://open" target="_blank">打开应用程序</a>
</body>
</html>
posted on 2023-09-12 17:55  杜jn  阅读(12)  评论(0编辑  收藏  举报