views:

48

answers:

3

Hi,

I didn't find a way to debug Greasemonkey scripts with the Firebug extension.

Does anyone know how to do this ?

Thanks.

+1  A: 

Because Greasemonkey operates in a sandbox, Firebug cannot see it. There is no easy way around this.

General workaround strategies:

  1. Test all parts of a GM script that don't use GM_ functions, in Firebug's JavaScript console first. Minimize use of GM_ functions and don't use GM_log() at all.

  2. All of Firebug's console functions work great from within a GM script.

Brock Adams
Thanks for your suggestions.
WolveFred
+1  A: 

Chromebug can see sandboxed scripts, http://getfirebug.com/wiki/index.php/Chromebug_User_Guide, but I've not tried it on Greasemonkey.

johnjbarton
A: 

I've tried Chromebug, it doesn't seem to be seeing them.

I have been able to inspect variables in Firebug by adding a debugger line in my GM code. This causes a breakpoint and I can inspect variables on the stack, but the right file is not shown so I can't step or anything.

There also is a extension called Firebugmonkey, but noone seems to know how to use it. I played with it for a while, but I can't figure it out either. https://addons.mozilla.org/en-US/firefox/addon/13623/reviews/

d

If you post a complete test case to http://code.google.com/p/fbug/issues/list then we can know how to fix it.
johnjbarton