Hitu Bansal
Hitu Bansal

Reputation: 3137

How to debug a Firefox Add-on SDK extension?

I am working on code for a Firefox Add-on SDK extension. I want to debug it.

Can we debug it like we do in Firebug? Firebug is not working for my add-on.

Upvotes: 1

Views: 714

Answers (2)

Makyen
Makyen

Reputation: 33306

As of July 2016:

You can use the Firefox Add-on Debugger.

Use the command jpm run --debug.

Then click on "OK" when asked to accept the incoming connection:

Accept Incoming Connection?

You will then have a debugger window from which you can select your JavaScript files:

Debugger window

I copied most of this answer from my answer to a different question.

Upvotes: 2

willlma
willlma

Reputation: 7533

First result on Google…

To enable the Add-on Debugger you need to check the "Enable chrome and addon debugging" and "Enable remote debugging" settings in Firefox.

To do this, select "Toggle Tools" from the Web Developer menu in Firefox, open the Developer Tools Settings, and check "Enable chrome and addon debugging" and "Enable remote debugging".

Now open the Add-on Manager. Next to the entry for your add-on you will see a button labeled "Debug". Click this button to launch the debugger.

Next you'll see a dialog asking you to accept an incoming connection. Click "OK", and the debugger will start in a separate window.

Upvotes: 5

Related Questions