[Greasemonkey] figuring out how to call my function within gmail

Tom Lee thomas.j.lee at gmail.com
Thu Mar 9 16:17:38 EST 2006


I'm trying to adapt my Gmail colorizer script (
http://www.metamonkey.net/gmailcolorizer/) to use the better properties of
this alternate colorizer script (http://userscripts.com/scripts/show/2433).
Namely, I want to call my HandleColorization function only when gmail makes
a callback.

The author of the alternate script has accomplished this by overriding the
F() function. However, I can't simply insert a call to HandleColorization()
there, because the F() function resides in top.main.js (gmail has two
frames, main and js -- js is where all the functions live).  And from F()'s
perspective, top.main.HandleColorization doesn't seem to work.

I'm afraid I don't really understand the proper use of unsafeWindow.  I've
tried a lot of different things, but none of them seem to work -- the
Greasemonkey-registered functions never seem to be visible from within the
DOM, which seems necessary for overriding gmail's native functions.

Can anyone suggest what I might be doing wrong, or how I could do it right?
Any guidance would be much appreciated.

Thanks.


More information about the Greasemonkey mailing list