0

It seems that Greasemonkey scripts in FF will only silently fail when errors are encountered. The script stops executing upon error, but unlike normal no error messages appear in the console. I'm reduced to littering the code with console.log() and guessing where the error is.

This prints "before" but not "after":

console.log("before");

// swallowed
syntax $% (error[;

console.log("after");

How can I get Greasemonkey script errors to show up in the console?

(or any solution better than throwing console.log() everywhere)

Using FF 42.0 and Greasemonkey 3.5

iPherian
  • 908
  • 15
  • 38
  • greasemonkey can be annoying like that - not much you can do about it – Jaromanda X Nov 16 '15 at 07:57
  • Greasemonkey used to silently fail a lot but rarely does these days. The trick is to **look in the right console**. See the duplicate question. If you still have difficulty, edit this question to **provide an MCVE**, and then comment-reply and the Q will be reopened. – Brock Adams Nov 16 '15 at 08:17
  • Try wrapping the suspicious chunk of code (or all of it) in `try{} catch(e) { console.log(e) }`. – wOxxOm Nov 16 '15 at 08:22
  • 1
    D'oh! I was looking in the page console not the browser console. – iPherian Nov 16 '15 at 14:04

0 Answers0