如何编写我的加载项代码,以便Firefox知道在哪里检查更新?

时间:2021-12-18 07:16:43

I am developing an Add-on and I am having trouble finding documentation that explains how to let Firefox know where to look for updates. If I post an .xpi on my website and the user downloads and installs that .xpi, does Firefox know to check that URL for changes? or do I have to put something in package.json?

我正在开发一个附加组件,我无法找到解释如何让Firefox知道在哪里查找更新的文档。如果我在我的网站上发布了.xpi并且用户下载并安装了.xpi,Firefox是否知道检查该URL是否有变化?或者我必须在package.json中放一些东西?

1 个解决方案

#1


2  

Are you using the online builder or the SDK command-line tool? You can only specify the update url using the cfx tool:

您使用的是在线构建器还是SDK命令行工具?您只能使用cfx工具指定更新网址:

https://developer.mozilla.org/en-US/Add-ons/SDK/Tools/cfx

https://developer.mozilla.org/en-US/Add-ons/SDK/Tools/cfx

When building your add-on, you would run cfx xpi with the following arguments:

构建加载项时,您将使用以下参数运行cfx xpi:

cfx xpi --update-link https://example.com/addon/latest
          --update-url https://example.com/addon/update_rdf

If you have already built your add-on using builder, a hackier option would be to download the xpi, unzip it, manually edit install.rdf and then re-zip it. See MDN for documentation on install.rdf syntax:

如果你已经使用构建器构建了加载项,那么hackier选项就是下载xpi,解压缩它,手动编辑install.rdf然后重新压缩它。有关install.rdf语法的文档,请参阅MDN:

https://developer.mozilla.org/en/Install_Manifests

https://developer.mozilla.org/en/Install_Manifests

#1


2  

Are you using the online builder or the SDK command-line tool? You can only specify the update url using the cfx tool:

您使用的是在线构建器还是SDK命令行工具?您只能使用cfx工具指定更新网址:

https://developer.mozilla.org/en-US/Add-ons/SDK/Tools/cfx

https://developer.mozilla.org/en-US/Add-ons/SDK/Tools/cfx

When building your add-on, you would run cfx xpi with the following arguments:

构建加载项时,您将使用以下参数运行cfx xpi:

cfx xpi --update-link https://example.com/addon/latest
          --update-url https://example.com/addon/update_rdf

If you have already built your add-on using builder, a hackier option would be to download the xpi, unzip it, manually edit install.rdf and then re-zip it. See MDN for documentation on install.rdf syntax:

如果你已经使用构建器构建了加载项,那么hackier选项就是下载xpi,解压缩它,手动编辑install.rdf然后重新压缩它。有关install.rdf语法的文档,请参阅MDN:

https://developer.mozilla.org/en/Install_Manifests

https://developer.mozilla.org/en/Install_Manifests