0

Have made quite a bit of progress in my quest to figuring out the Mozilla extension platform, but am still struggling with a few issues.. Hoping someone here can point me in the right direction once again :)

Ok, so here is the issue... I have been messing around with the online addon builder app here: https://builder.addons.mozilla.org/

Great, this seems to be working ok for testing simple addons. But it includes so much extra junk - stuff I am not using and don't need there.

Now when I download the .xpi file, rename it to .zip, and extract it to work on the files, when I repackage it to a zip -> xpi, Firefox tells me the package is corrupt when I try to install.

I have deduced that this is because the package is "signed" or something, and when I repackage it myself this is not happening.

Whatever. This is getting ridiculous...

So I want to use the SDK to work locally, and then just include the SDK in the directory somehow. But it looks like I need to install python and run something in order to generate some files first blah blah blah.... are you joking me? I can't just code my app, then include the SDK files?

QUESTION:

How can I create my basic addon/extension with the online Addon Builder, then edit the files locally, repackage it, and use it?

4

1 回答 1

1

使用 SDK 创建的附加组件当前未签名(请参阅错误 613618)。包清单中有一堆 SHA256 校验和,但没有任何东西可以验证它们(也许它们是为了通过外部工具进行验证,我不知道)。所以这不是你遇到的问题。

最可能的问题是,当您重新打包 ZIP 文件时,您没有保留目录结构。该install.rdf文件需要位于包的顶层,而不是某些子目录中。您可以使用unzip -l mypackage.xpi- 它应该列出install.rdf没有任何目录名称的列表。

一般来说,我建议不要操纵 XPI 文件。通过删除未使用的模块,您可能能够节省 100 kB 的下载大小,很可能更少 - 安装您的附加组件的人甚至不会注意到下载大小的差异。未使用的模块对附加组件的性能影响为零。但是您可能会以不明显的方式删除实际使用的东西。一旦 AMO 开始自动重新打包 SDK 附加组件,它们无论如何都会用标准包替换您的附加组件。

于 2011-10-07T05:55:55.137 回答