Debugging GM4 scripts in FF Dev Edition

130 views
Skip to first unread message

Benedikt Bauer

unread,
Nov 17, 2017, 9:38:07 PM11/17/17
to greasemonkey-users
Hey there,

is this another one of those nasty web extension problems noone saw coming or deemed important enough for fx57 to be fixed?

I've successfully managed to get a UserScript loaded into the Greasemnkey Extension and have it enabled on the site.
However when I open the DevTools, there's no sign of this script even existing at all.

According to Mozilla there should be a unique moz-extension:// namespace for each extension in which content scripts would be listed.
It seems like this isn't true for content scripts inserted via the programmatic way and/or using inline code instead of a source file.

Debugging the Greasemonkey Extension itself only gets me to the point where the script is inserted, but I can't debug the executeScript call or the processed script in any way.

I suppose this is a Firefox issue and not a problem of Greasemonkey, right?

Anthony Lieuallen

unread,
Nov 19, 2017, 12:26:02 PM11/19/17
to greasemon...@googlegroups.com
This is a limitation of A) the choices available and B) the time to implement anything before Firefox 57 hit.

I'd guess that inserting a `debugger;` statement might help you, but I haven't tried it myself.

Benedikt Bauer

unread,
Nov 19, 2017, 4:01:55 PM11/19/17
to greasemon...@googlegroups.com
That stops execution and the callstack and environment are visible, but you can't see the user script code itself.

I've opened a bug at Mozilla, because I think this is a generic problem with the debugger not seeing sandboxed inline content scripts (for example that's everything that's run via executeScript and does not have a physical file representation inside the extension, including, but not limited to user scripts).

Am 19. November 2017 18:25:57 MEZ schrieb Anthony Lieuallen <aran...@gmail.com>:
This is a limitation of A) the choices available and B) the time to implement anything before Firefox 57 hit.

I'd guess that inserting a `debugger;` statement might help you, but I haven't tried it myself.


--
Gruß,
Benedikt Bauer
Reply all
Reply to author
Forward
0 new messages