delta9
delta9

Reputation: 403

Problems Repackaging Mozilla Addon Builder Extension Files

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?

Upvotes: 0

Views: 707

Answers (1)

Wladimir Palant
Wladimir Palant

Reputation: 57681

Add-ons created with the SDK currently aren't signed (see bug 613618). There are a bunch of SHA256 checksums in the package manifest but nothing is verifying them (maybe they are meant for verification by external tools, I don't know). So this is not the problem you are experiencing.

Most likely issue is that when you repacked the ZIP file you didn't keep the directory structure. The install.rdf file needs to be at the top level of the package, not in some subdirectory. You can check it with the unzip -l mypackage.xpi - it should list install.rdf without any directory name.

Generally, I would advise against manipulating the XPI files. By removing unused modules you might be able to save 100 kB in download size, most likely less - somebody installing your add-on will not even notice the difference in download size. Modules that aren't used have zero impact on performance of your add-on. But you risk removing something that is actually used, maybe in a non-obvious way. And once AMO starts repacking SDK add-ons automatically they will replace your add-on by the standard package anyway.

Upvotes: 1

Related Questions