【问题标题】:Native messaging (firefox) host path contains space本机消息传递 (firefox) 主机路径包含空格
【发布时间】:2016-11-18 08:00:48
【问题描述】:

我在使用本机消息 (Firefox) 时遇到了这个问题: 如果我的本机清单路径(在 Windows 注册表中)json 包含空格

例如C:\src\Java Signing Addon\Setup\bin\native_manifest.json

如果在 windows cmd 中使用这样的路径,我会得到熟悉的错误:

stderr output from native app lt.dlx.sign: 'C:\src\Java' is not recognized as an internal or external command

同样的路径在 Chrome

上运行得很好

现在,如果我用双引号将路径括起来,我会得到一个不同的错误:

"Win error 123 during operation open on file C:\src\Java Signing Addon\Setup\bin\native_manifest.json" (The filename, directory name, or volume label syntax is incorrect.)

做了很多谷歌搜索,但什么都没有:/

【问题讨论】:

  • 可以发一下native_manifest.json的内容吗?
  • { "name": "lt.dlx.sign", "description": "Test", "path": "run.bat", "type": "stdio", "allowed_extensions": [ "sign@doclogix.com" ] } 和 run.bat @echo off java -cp "%~dp0/SignatureApplet.jar" <mainclass> %* 同样在 Chrome 中使用,效果很好。

标签: firefox path firefox-addon registry chrome-native-messaging


【解决方案1】:

您可以尝试为目录添加窗口短名称。

要发现它,请运行命令 dir /x 。如果您从 .bat 添加它,您可以使用 %~sdp0 以简短形式获取当前路径。

也可以查看how to get DOS path instead of Windows path

【讨论】:

  • 是的,这也是我想出的唯一解决方案。
【解决方案2】:

我在 Windows Firefox 50 上遇到了同样的问题。这是一个错误https://bugzilla.mozilla.org/show_bug.cgi?id=1323148

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多