Greasemonkey Userscripts

Any suggestions on how to use WebStorm to debug Greasemonkey userscripts?

1
5 comments

I doubt that it's possible. It seems that scripts loaded by Greasemonkey don't have URLs so you cannot put breakpoints in they.

0

Greasemonkey obviously has to load the script from somewhere. In my case the URL for that "somewhere" happens to be file:///MacBook%20HD/Users/slessard/Library/Application%20Support/Firefox/Profiles/4uesnl4h.default/gm_scripts/chase/chase.user.js.

But if debugging in Greasemonkey isn't possible then is it possible to debug locally injected JavaScript on a remote web page for which I do NOT have server access?

0

Greasemonkey user scripts are indeed stored in that directory. But it seems that Greasemonkey firstly load a script from a file and then executes script text in Firefox so the URL of the script isn't passed to Firefox.

What do you mean by 'do NOT have server access'? If you're able to open the remote page in the browser you can debug it using 'JavaScript Debug -> Remote' configuration.

0

Now, in 2020, is there any way to do this? Not necessarily greasemonkey only - tampermonkey, violentmonkey, ace script and so on are good.

1
Avatar
Permanently deleted user

You can use Chrome Console for debugging, not sure if it can be integrated with Jetbrains IDEs

0

Please sign in to leave a comment.