9

I'm trying to use Firebug to debug a JavaScript file in an extension I've added to Fx 4.
Can anyone tell me how to do it? I can only see website scripts.

Andy E
  • 338,112
  • 86
  • 474
  • 445
eve
  • 2,959
  • 4
  • 21
  • 18

4 Answers4

13

Use Chromebug it's firebug for extension development, witch will give you the full ability to inspect debug firefox it self and all firefox extension as if it's a webpage :)

1- install the latest version from here: http://getfirebug.com/releases/chromebug/

2- Winkey+R to open run then type firefox.exe -chromebug this will run firefox with chromebug

3- for more information visit http://getfirebug.com/wiki/index.php/Chromebug

Fareed Alnamrouti
  • 30,771
  • 4
  • 85
  • 76
  • 4
    Chromebug doesn't work anymore, but you can use the firefox native. See here: http://stackoverflow.com/a/17579253/746754 – acarlon Nov 22 '13 at 23:14
4

Please see MDN - Building An Extension - Debugging Extensions, which shows what tools Firefox provides you with to natively debug extension, also take a look at Dive Into Greasemonkey - Debugging User Scripts (PDF, p.13) which is aimed more specifically at your request.

Other than that, see How to debug a Greasemonkey script with the Firebug extension?

Gerold Broser
  • 14,080
  • 5
  • 48
  • 107
Tamara Wijsman
  • 12,198
  • 8
  • 53
  • 82
3

On Firefox 19 or later, it's possible to use the built-in JS debugger on the browser itself. Go to about:config and set the following two prefs:

devtools.chrome.enabled: true
devtools.debugger.remote-enabled: true

After you restart the browser, you can access the Browser Debugger through Tools > Web Developer > Browser Toolbox.

(note that you must accept the incoming connection)

See more at: https://developer.mozilla.org/en-US/docs/Mozilla/Debugging/Debugging_JavaScript#JavaScript_Debugger

Gerold Broser
  • 14,080
  • 5
  • 48
  • 107
Jan Odvarko
  • 421
  • 3
  • 4
-2

In the bottom right hand corner there should be a little Firebug icon. Single or double click to open then you see some tabs at the top. Click the "Console" tab for real time debugging, or the "SCript" tab to view the scripts that have been loaded. Note, you can also load CSS and HTML through Firebug, use the "Viewer" icon to view HTML code on the page in real time.

  • 2
    The script tab only shows the website scripts, not _my_ script from the extension I've added. – eve Jun 04 '11 at 20:19