【问题标题】:Failed to sign Firefox WebExtensions with web-ext无法使用 web-ext 签署 Firefox WebExtensions
【发布时间】:2017-01-17 09:21:57
【问题描述】:

我正在将 Chrome 扩展程序移植到 Firefox WebExtensions。在 Chrome 上一切正常。

我在 Firefox 上试过这些:

1.修改我的扩展使其与Firefox WebExtensions兼容,然后通过Load Temporary Add-on将其加载到Firefox中,一切正常

2. 通过npm install -g web-ext 安装web-ext 模块。然后我运行web-ext run,Firefox 成功启动并安装了我的扩展

3.运行web-ext build,然后在Firefox上安装打包的扩展,一切正常

D:\temp>web-ext build
Building web extension from D:\temp
Your web extension is ready: D:\temp\web-ext-artifacts\my_extension-1.0.zip

4. 然后我运行web-ext sign --api-key=MyApiKey --api-secret=MyApiSecret,它失败并出现错误:

D:\temp>web-ext sign --api-key=MyApiKey --api-secret=MyApiSecret
Building web extension from D:\temp

sign: Error: ENOTEMPTY: directory not empty, rmdir 'C:\Users\abc\AppData\Local\Temp\tmp-web-ext-628J9dJMBi0bWRX'
    at Error (native)
    at Object.fs.rmdirSync (fs.js:806:18)
    at _rmdirRecursiveSync (C:\Users\abc\AppData\Roaming\npm\node_modules\web-ext\node_modules\tmp\lib\tmp.js:284:10)
    at TempDir._cleanupCallback [as _removeTempDir] (C:\Users\abc\AppData\Roaming\npm\node_modules\web-ext\node_modules\tmp\lib\tmp.js:408:5)
    at TempDir.remove (C:\Users\abc\AppData\Roaming\npm\node_modules\web-ext\dist\webpack:\src\util\temp-dir.js:9:4939)
    at C:\Users\abc\AppData\Roaming\npm\node_modules\web-ext\dist\webpack:\src\util\temp-dir.js:9:3976
    at process._tickCallback (node.js:401:9)

sign: Error code: ENOTEMPTY

我进入C:\Users\abc\AppData\Local\Temp\tmp-web-ext-628J9dJMBi0bWRX,实际上它是空的。有人知道为什么会这样吗?

我的 api key 和 api secret 用于旧的 Firefox JSCTypes 附加组件。这就是我不断收到此错误的原因吗?

这里是document of web-ext

【问题讨论】:

    标签: firefox-addon-webextensions


    【解决方案1】:

    此问题的解决方案

    经过一番挖掘,我发现导致此错误的原因是我在网络上使用了代理。我尝试通过运行命令set HTTP_PROXY=MyProxyServerAddress设置代理,然后错误消失。

    其他故障排除

    然后我再次尝试运行web-ext sign,发现另一个错误:

    Server response: You do not own this addon. (status: 403)
    sign: WebExtError: The WebExtension could not be signed
    

    我将我的插件(由web-ext build 生成的打包)上传到Mozilla Add-on Site,然后再次运行web-ext sign。这次插件签名成功。

    注意:每次运行 web-ext sign 时,您都需要更改插件的版本。否则会失败并报错:Server response: Version already exists. (status: 409)

    干杯!

    【讨论】:

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