[Greasemonkey] So, what about top, et al.?

Aaron Boodman zboogs at gmail.com
Sat Aug 6 22:53:17 EDT 2005


You should always access the DOM starting with |window| or |document|.
You shouldn't use |unsafeWindow| except when you want to access
javascript which the page you are monkeying with defined.

Any of the below are good:

window.top
window.parent
window.frames[0]

var w = window
w.top
w.parent
w.frames[0]

These are *not* ok:

top
parent
frames[0]

-- 
Aaron

On 8/6/05, Bill Donnelly <donnelly at snowcrest.net> wrote:
> Are we supposed to use unsafewindow.top just to be safe?
> Is it required? Same for parent? What about self?
> 
> --
> Sometimes bad things happen to good people.
> When that happens, those good people should
> seek out and find some bad people.
> And then do something bad to them.
> Just to even things out.
> It's only fair, after all.
> 
> _______________________________________________
> Greasemonkey mailing list
> Greasemonkey at mozdev.org
> http://mozdev.org/mailman/listinfo/greasemonkey
>


More information about the Greasemonkey mailing list