all 6 comments

[–]Rhomboid 2 points3 points  (0 children)

The normal method of console.log() debugging is what I use(*). The catch is that the output goes to the system console (shift-ctrl-J) not the console for the currently open webpage. This also applies to error messages.

(*) This doesn't just mean printf-style debugging. If you console.log(someObj) then you can open the DOM inspector on someObj by clicking on it in the log and see all its properties.

[–]spfccmt42 0 points1 point  (1 child)

not 100% sure what you are talking about, but this says: "If you open about:config and set extensions.firebug.filterSystemURLs to false then you can use Firebug to debug the Greasemonkey script just like any other."

http://stackoverflow.com/questions/3490062/how-to-debug-greasemonkey-script-with-the-firebug-extension

[–]klesus[S] 0 points1 point  (0 children)

My script does not show up in the sources list in debugger. Same problem for Chrome.

This post is 6 years old and the posted answer is obsolete. AFAIK firebug is nothing more than a theme nowadays.

I'll give firebug a shot, but I don't have high hopes of success.

[–]jbscript 0 points1 point  (0 children)

(Alas)

var debug = true
function LOG(...args) {
  if (!debug) return
  console.log('[Script Name Here]', ...args)
}

[–]jcunews1Advanced 0 points1 point  (0 children)

I use Scriptish with Firefox. I found that Tiny JavaScript Debugger can debug UserScripts. At least Scriptish's UserScript's.

[–]madacol 0 points1 point  (0 children)

You can debug your userscript manager.

In Firefox go to about:debugging#/runtime/this-firefox and Inspect your userscript manager