I am an advanced user and have some programmer skills but I have installed some firefox add-on and I\'d like to add some extra code line to original code. But I\'ve only got
Essentially you just zip up stuff again (non-SDK add-ons). And those add-ons you linked are non-SDK add-ons.
However there are some pitfalls:
META-INF
folder. Modifying stuff will of course invalidate the signature. Just remove the folder to make the (modified) extension unsigned again..xpi
) then contains /some-addon-folder/install.rdf
instead of just /install.rdf
. Make sure to not zip the outer folder, just the files and subfolders within.This is correctly zipped:
$ unzip -l http_request_logger-0.1-fx.xpi
Archive: http_request_logger-0.1-fx.xpi
Length Date Time Name
-------- ---- ---- ----
240 07-29-11 11:45 chrome.manifest
0 07-29-11 11:42 components/
1558 07-29-11 11:47 components/httpRequestLogger.js
1021 07-30-11 12:39 install.rdf
-------- -------
2819 4 files
This is not correctly zipped (produced by using the OSX compress menu item):
$ unzip -l http_request_logger-0.1-fx.zip
Archive: http_request_logger-0.1-fx.zip
Length Date Time Name
-------- ---- ---- ----
0 05-16-14 01:54 http_request_logger-0.1-fx/
240 07-29-11 11:45 http_request_logger-0.1-fx/chrome.manifest
0 05-16-14 01:54 __MACOSX/
0 05-16-14 01:54 __MACOSX/http_request_logger-0.1-fx/
187 07-29-11 11:45 __MACOSX/http_request_logger-0.1-fx/._chrome.manifest
0 07-29-11 11:42 http_request_logger-0.1-fx/components/
1558 07-29-11 11:47 http_request_logger-0.1-fx/components/httpRequestLogger.js
0 05-16-14 01:54 __MACOSX/http_request_logger-0.1-fx/components/
187 07-29-11 11:47 __MACOSX/http_request_logger-0.1-fx/components/._httpRequestLogger.js
1021 07-30-11 12:39 http_request_logger-0.1-fx/install.rdf
187 07-30-11 12:39 __MACOSX/http_request_logger-0.1-fx/._install.rdf
187 05-16-14 01:54 __MACOSX/._http_request_logger-0.1-fx
-------- -------
3567 12 files
(Aside from the __MACOSX
crap, it is http_request_logger-0.1-fx/install.rdf
now)
I recommend you also read Setting up an extension development enviroment, in particular the bits about the proxy file. ;)
When it comes to SDK add-ons (as indicated by the presence of a harness-options.json
file), re-zipping may or not work. It might be better to just reproduce a package.json and directory structure based on the .xpi
contents and use the SDK cfx
tool to build a new XPI.