I've made an extension using the addon sdk, and it works as expected when running with cfx run
. But when I pack it in to an xpi using cfx xpi
and install it - it stops working - no scripts are injected and I'm not even getting any errors :(
Any ideas on how to fix this, or how can I debug this kind of issue?
Found a solution. I'm simply using the .xpi that Firefox packs automatically for testing. In order to use it, run the cfx run
with the -p
parameter pointing to a profile you've created, like this:
cfx run -p <your path to firefox>\profiles\someprofile
After running, go the that profile's folder, and find in there the extensions folder, it should be something like this:
<your path to firefox>\profiles\someprofile\extensions
In there you'll have your addon with a weird file name and an .xpi
file extension. Rename it to anything you want, leaving the .xpi
file extension intact.
EDIT:
Apparently the cfx xpi
command strips by default what it thinks to be unused modules and .js
files. To avoid this you need to run it with a special flag, like this: cfx xpi --no-strip-xpi