6

How to debug Greasemonkey scripts in Firebug?

I can't debug any Greasemonkey scripts in Firebug because they don't appear in the list under the Script tab (anymore).

The answers at "How to debug Greasemonkey script with the Firebug extension?" apparently don't work with the latest versions of Firefox + Firebug?

I've tried:

  • Creating a new Firefox profile
  • about:config setting extensions.firebug.filterSystemURLs to false
  • Updating to Firebug 2.0.2

I had this problem before and solved it by creating a new Firefox profile but that hasn't worked this time. Please does anyone know how to get this working or if there is an alternative to Firebug that works with Greasemonkey?

I'm on Firefox 31.0.

Community
  • 1
  • 1
user3759830
  • 61
  • 1
  • 2
  • 3
  • 1
    FF 31 greatly improved debugging, allegedly, but I haven't played around with that yet. Last I checked, GM debugging with Firebug was busted again on FF30. Try FF's native debugger. – Brock Adams Jul 31 '14 at 10:38
  • New Debugging in FF31 mostly refers to bootstrapped addons. I use console for debugging GM scripts. – erosman Jul 31 '14 at 11:27
  • 1
    What if you put `debugger` keyword in your script and run it with debugger active? Will it stop there and show you the source? – MadBender Jul 31 '14 at 11:36
  • @MadBender, that doesn't work for a Greasemonkey script. – Brock Adams Jul 31 '14 at 11:53
  • 3
    You can use the "Browser Toolbox" to debug GM scripts. See [this answer](http://stackoverflow.com/a/17579253/331508) for how to enable it. I do not recommend this though, because it lays bare the whole browser and you can really frak things up if you're not very careful. – Brock Adams Jul 31 '14 at 11:59

1 Answers1

3

Issue 7513: 2.0 cannot debug userscripts in Greasemonkey

Firebug 1.x works with Greasemonkey 1.x well, while I can debug userscripts installed in Greasemonkey using Firebug to set a breakpoint. But after I upgrade my Firefox to 30 and the Firebug was upgraded to 2.0. It seems does not work any more.

Project Member simon.lindholm10

Not that surprising, the method of script discovery changed pretty fundamentally in 2.0... Previously we were iterating over all scripts everywhere and trying to tie them somewhere, now we start from the web page and hook script creation for it, which is much more sane.

The way to get this fixed (presuming it doesn't work in the built-in debugger) is to file it against Devtools at https://bugzilla.mozilla.org, or against Greasemonkey; there's very little we can do on the Firebug side I believe.

S-ed
  • 31
  • 3