[Greasemonkey] GM-TNG - several bugs fixed

Aaron Boodman zboogs at gmail.com
Wed Jul 27 12:21:08 EDT 2005

> I'm just worried about losing the ability to do this when Deer Park is
> the standard.

You never will. 

Modifying the JavaScript environment of the target page is an
important feature of Greasemonkey. But it's also important that you
not do this on accident. Just creating a global variable in a user
script should not clobber a global of that same name in the target
document. That would suck. You should have to try to do it.

Which is exactly what the |unsafeWindow| global variable is for in
0.4.x. When you want to access the real content window, you can use

For instance: 

unsafeWindow.contentFunctionWhichIWantToChange = function() { ... }

I named it "unsafeWindow" to make it clear that the functions and
properties in this window are not to be trusted. But maybe it would
make more sense - and be less scary - to just call it "contentWindow".


More information about the Greasemonkey mailing list