1
votes

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?

4

4 Answers

4
votes

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

0
votes
  • try to uninstall and then reinstall the addon you developed
  • try installing the addon on another firefox build(aurora, nightly, beta)
0
votes

What I do in such a case:

  1. Disable extension from Addon Manager.
  2. Restart Firefox.
  3. Open Console Window (Ctrl+Shift+J)
  4. Enable extension and watch for errors in Console.

Sometimes startup errors do not appear in Console window unless it is already opened.

0
votes

Resetting firefox worked for me.

  1. Type about:troubleshooting in your address bar
  2. Click the reset firefox button in the upper-right hand corner of the Troubleshooting page screenshot
    (source: mozilla.net)

  3. Confirm your action