I’m trying to write my first Firefox extension (I use Firefox 8.0.1) and I’m stuck:
I have a working sample from https://addons.mozilla.org/en-US/developers/tools/package/ – downloaded file plugin.zip renamed to plugin.xpi seems to be OK. Then I extract it to folder, and without any modification compress it again (using default Ubuntu 10.04LTS context menu package archiver). When I’m trying to install recompressed_plugin.xpi Firefox returns:
“This add-on could not be installed because it appears to be corrupt.”. What am I doing wrong?
Which compression tools should I use to get it working? How can I determine the internal ZIP type (both files plugin.zip and recompressed_plugin.zip have the same MIME type: Zip archive (application/zip))?
You didn’t compress the package correctly – this message means that there is no
install.rdfat the top level of your ZIP file. You’ve probably runzip recompressed_plugin.xpi plugin/instead ofzip recompressed_plugin.xpi plugin/*. To test rununzip -l recompressed_plugin.xpi, it should listinstall.rdfand notplugin/install.rdfor something like that.