It is beyond anything you have ever experienced or imagined
Posts tagged greasythug
Using GreasyThug to Answer a Greasemonkey Question
Mar 4th
On StackOverflow a user asked: How can I create an object of a class which defined in the remote page?
The page includes code like this (which I entered into Firebug):
function foo(){ this.bar = 0; }
Then I verified that it could be read from Greasemonkey with the GreasyThug console by the following expression:
_foo = unsafeWindow.foo;
x = new _foo();
This caused a “Not enough arguments” error, whatever the hell that is. Not quite the poster’s actual error. What if we added an argument? “Illegal Value” Bingo! Replicated the issue. Now to solve it.
Let’s try and migrate the function over into the Greasemonkey script zone.
_foo = eval('(' + unsafeWindow.foo.toSource() + ')')
=> function foo(){ this.bar = 0; }
That’s the ticket! Now to instantiate and verify:

Ship it! Holla!
Update to GreasyThug – Annotations
Feb 28th
Get the latest version here. Now supports personal notes. They’re not really “private”, just notes for individuals. Coming soon will be group support.

