效果:
1、添加应用程序注册表
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\应用名称] "URL Protocol"="" @="应用名称" [HKEY_CLASSES_ROOT\应用名称\DefaultIcon] @="应用程序绝对路径,1" [HKEY_CLASSES_ROOT\应用名称\shell] [HKEY_CLASSES_ROOT\应用名称\shell\open] [HKEY_CLASSES_ROOT\应用名称\shell\open\command] @="\"应用程序绝对路径\" \"%1\""
如:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\potplayer]
"URL Protocol"=""
@="potplayer"
[HKEY_CLASSES_ROOT\potplayer\DefaultIcon]
@="E:\\software\\PotPlayer\\PotPlayerMini64.exe,1"
[HKEY_CLASSES_ROOT\potplayer\shell]
[HKEY_CLASSES_ROOT\potplayer\shell\open]
[HKEY_CLASSES_ROOT\potplayer\shell\open\command]
@="\"E:\\software\\PotPlayer\\PotPlayerMini64.exe\" \"%1\""
2、Js传参
<a href="potplayer://'+data.list[i].serverUrl+'">' + data.list[i].name + '</a>
扩展:
Pluggable Protocol,又叫URL Protocol,有时会叫Shell命令,常见的Protocol有http、ftp、telnet、mailto(outlook)、ed2k(迅雷)、等。。
系统支持哪些协议,可以通过查询注册表HKEY_CLASSES_ROOT/PROTOCOLS/handler看到: