Chrome中的自定义协议无法按预期运行 [英] Custom protocol in Chrome not working as expected

查看:186
本文介绍了Chrome中的自定义协议无法按预期运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的注册文件如下所示(Exoscape.reg):

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\""

我的文件位于正确的位置,当我尝试在CMD中进行测试时,我没有出现任何错误,但是没有启动:

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"

我的HREF标记在我的站点中看起来像这样,当我单击时,我会看到打开启动器"提示,当按下该提示时,它不会启动任何内容:

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>

我想念什么?

推荐答案

如果您已导出任何现有协议定义(即\HKCR\http\\HKLM\SOFTWARE\Classes\http\而不是\HKCU\*)并将其与您的协议定义进行比较,则您会注意到它至少应为"URL Protocol"=""(未设置,不能为空文本).另外,空行可能会激怒REGEDIT来正确导入文件.

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.

因此,将其导出,根据需要进行修改,然后重试.为什么您省略了DefaultIcon的路径?

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

这篇关于Chrome中的自定义协议无法按预期运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆