如何制作xpi文件并发布我的FireFox扩展?

时间:2021-01-21 07:07:51

I have made a simple FireFox extension and would like to upload it to AMO.

我已经制作了一个简单的FireFox扩展,并希望将其上传到AMO。

With Chrome this is DEAD EASY....zip the directory, upload to the developer dashboard, done.

使用Chrome,这是DEAD EASY ....压缩目录,上传到开发人员仪表板,完成。

For FireFox, I apparently have to make my extension into an xpi file? How the heck do I do this with FireFox?

对于FireFox,我显然必须将我的扩展扩展为xpi文件?我怎么用FireFox做到这一点?

I made an account at https://addons.mozilla.org/en-US/developers/addon/submit/2

我在https://addons.mozilla.org/en-US/developers/addon/submit/2上创建了一个帐户

And have read https://developer.mozilla.org/en-US/Add-ons/Distribution but I still can't figure out how to make the xpi file I need to upload.

并阅读了https://developer.mozilla.org/en-US/Add-ons/Distribution,但我仍然无法弄清楚如何制作我需要上传的xpi文件。

2 个解决方案

#1


1  

XPI is simply a ZIP file. Use any ZIP application, make a ZIP of your addon and then change its extension to XPI.

XPI只是一个ZIP文件。使用任何ZIP应用程序,制作您的插件的ZIP,然后将其扩展名更改为XPI。

#2


-1  

I use a windows batch file (.bat) to build the extension. It looks like this:

我使用Windows批处理文件(.bat)来构建扩展。它看起来像这样:

set dest=(your extension name)
set ZIP="C:\Program Files (x86)\7-Zip\7z.exe"
del %dest%.*
%ZIP% a -tzip -mx=9 %dest%.xpi chrome\*
%ZIP% a -tzip -mx=9 %dest%.xpi modules\*
%ZIP% a -tzip -mx=9 %dest%.xpi install.rdf
%ZIP% a -tzip -mx=9 %dest%.xpi chrome.manifest
%ZIP% a -tzip -mx=9 %dest%.xpi defaults\preferences\*
copy %dest%.xpi %dest%.zip"

#1


1  

XPI is simply a ZIP file. Use any ZIP application, make a ZIP of your addon and then change its extension to XPI.

XPI只是一个ZIP文件。使用任何ZIP应用程序,制作您的插件的ZIP,然后将其扩展名更改为XPI。

#2


-1  

I use a windows batch file (.bat) to build the extension. It looks like this:

我使用Windows批处理文件(.bat)来构建扩展。它看起来像这样:

set dest=(your extension name)
set ZIP="C:\Program Files (x86)\7-Zip\7z.exe"
del %dest%.*
%ZIP% a -tzip -mx=9 %dest%.xpi chrome\*
%ZIP% a -tzip -mx=9 %dest%.xpi modules\*
%ZIP% a -tzip -mx=9 %dest%.xpi install.rdf
%ZIP% a -tzip -mx=9 %dest%.xpi chrome.manifest
%ZIP% a -tzip -mx=9 %dest%.xpi defaults\preferences\*
copy %dest%.xpi %dest%.zip"