Custom protocol in Chrome not working as expected

扶醉桌前 提交于 2019-12-23 04:47:22

问题


My register file looks like this (Exoscape.reg):

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Classes\exoscape-launcher]
"URL Protocol"="\"\""

@="\"URL:ExoScape-Launcher Protocol\""

[HKEY_CURRENT_USER\Software\Classes\exoscape-launcher\DefaultIcon]
@="\"Launcher.jar,1\""

[HKEY_CURRENT_USER\Software\Classes\exoscape-launcher\shell]

[HKEY_CURRENT_USER\Software\Classes\exoscape-launcher\shell\open]

[HKEY_CURRENT_USER\Software\Classes\exoscape-launcher\shell\open\command]
@="\"C:\\Program Files\\ExoScape\\Launcher.jar\" \"%1\""

My files are inside the correct location, when I try to test this in CMD I get no error but nothing launches:

"C:\Program Files\ExoScape\Launcher.jar" "ExoScape-Launcher:Launcher.jar"

My HREF tag looks like this in my site, when clicked, I get the Open Launcher prompt which when pressed, launches nothing:

<a href="ExoScape-Launcher:Launcher.jar">Play Now</a>

What am I missing?


回答1:


If you'd have exported any existing protocol definition (i.e. \HKCR\http\ or \HKLM\SOFTWARE\Classes\http\ instead of \HKCU\*) and compared that to your one then you'd have noticed that it should be at least "URL Protocol"="" (unset, not empty text). Also the empty line might irritate REGEDIT to properly import your file.

So, export that, modify it to your needs, and try again. And why have you omitted the path for DefaultIcon?



来源:https://stackoverflow.com/questions/56810591/custom-protocol-in-chrome-not-working-as-expected

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!