gpt4 book ai didi

javascript - 我可以在不安全的服务器上自行分发 Firefox Web 扩展吗

转载 作者:行者123 更新时间:2023-11-30 20:57:55 28 4
gpt4 key购买 nike

我写了一个插件,假设它包含一些敏感信息,我只想与一群人分享它,同时还保持为其分发更新的能力。

在我可以自行分发之前,需要将它上传到 addons.mozilla.org 以便进行签名,并且需要在有新版本或更新可用时指出更新 list 文件。

我的更新文件如下所示:

{
"addons": {
"my_private_addon@example.com": {
"updates": [
{ "version": "0.1",
"update_link" : "http://example.com/addon_update_v_0.1.xpi",
"update_hash" : "sha256:0FEE5D33C13546A599A54085DA6AC28FBF3D1678"
},
{ "version": "0.2",
"update_link" : "http://example.com/addon_update_v_0.2.xpi",
"update_hash" : "sha256:C7C067E755B51A0D09BEB25B463CD25CCE26C92C"
},
]
}
}
}

到目前为止一切顺利。但是我的主要插件 list 文件包含一个 update_url 导致地址不安全,因此插件验证被拒绝:

"applications": {
"gecko": {
"id": "my_private_addon@example.com",
"update_url": "http://example.com/addon_update.json"
}
}

Mozilla 插件页面错误:

"/applications/gecko/update_url" should match format "secureUrl"

Error: Your JSON file could not be parsed.

我明白为什么会发生此错误,但我正在寻找解决方法。是否只有在您拥有安全的服务器供您使用时才能自行分发您的插件?

最佳答案

如果您还提供 update_hash,则可以选择使用不安全的 update_url

A cryptographic hash of the file pointed to by update_link. This must be provided if update_link is not a secure URL. If present, this must be a string beginning with either sha256: or sha512:, followed by the hexadecimal-encoded hash of the matching type.

更多信息:https://developer.mozilla.org/en-US/Add-ons/Updates

关于javascript - 我可以在不安全的服务器上自行分发 Firefox Web 扩展吗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47464047/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com