Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't debug greasemonkey script using firebug or firefox debugger

I found two posts on this but still doesn't seem to be working. I don't see the user.js script in the drop down menu on either firebug or the built-in firefox debugger. I'm still just learning coding and couldn't figure out the workaround strategies. Any help would be greatly appreciated.

How to debug Greasemonkey script on Firefox 30?

How to debug Greasemonkey script with the Firebug extension?

Firefox 35.0

like image 537
bigbucky Avatar asked Jan 15 '15 02:01

bigbucky


1 Answers

The only way I've found to debug greasemonkey scripts is to use the browser console to get clues and then add alerts in my code where I think the problem is... then if the alert doesn't show up I know the problem is earlier in the code. My code usually ends up looking kinda like this pseudo code:

var i = get.value.from.page

alert(i)


do stuff to i

alert(i)

if (i===5){
do this stuff
alert ("i equaled 5")
}
else{
do this stuff instead
alert("i didn't equal 5, it equaled "+i)
}

Yeah, it's messy and time consuming... but it works.

like image 117
Kat Cox Avatar answered Nov 04 '22 13:11

Kat Cox