JS打开PC端本地exe应用程序方法

通过URL Protocol实现网页调用本地应用程序

1.记事本(或其他文本编辑器)创建protocal.reg文件

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Webshell]
@="URL:Webshell Protocol Handler"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\Webshell\DefaultIcon]
@="C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe"
[HKEY_CLASSES_ROOT\Webshell\shell]
[HKEY_CLASSES_ROOT\Webshell\shell\open]
[HKEY_CLASSES_ROOT\Webshell\shell\open\command]
@="\"C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe\" \"%1\""

2.打开文件后修改内容参考下图

《JS打开PC端本地exe应用程序方法》

2.1修改可执行文件路径

示例为谷歌浏览器

《JS打开PC端本地exe应用程序方法》
《JS打开PC端本地exe应用程序方法》

3.运行protocal.reg文件,添加到注册表

4.创建html使用方法如下

《JS打开PC端本地exe应用程序方法》

    原文作者:gaomu_v
    原文地址: https://blog.csdn.net/gaomu_v/article/details/114869786
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞