[Greasemonkey] GM & JavaScript/Applet Interaction

Aaron Boodman zboogs at gmail.com
Sat Oct 14 20:29:13 PDT 2006


unsafeWindow is always worse. :-) If there is a way to do something
besides unsafeWindow, use it.

- a

On 10/14/06, Jesse Merriman <jessemerriman at warpmail.net> wrote:
> Ah yes, that's it, thanks. In fact I read other parts of that page, but
> obviously not enough of it. Pitfall #8 led me to another solution:
>
>     var applet = unsafeWindow.document.getElementById('TestApplet');
>     applet.foo();
>
> Not sure which is worse, your hack or the use of unsafeWindow...
>
> --
> Jesse Merriman
> jessemerriman at warpmail.net
> http://www.jessemerriman.com/
>
>
> Lenny Domnitser wrote:
> > The problem is on this line:
> >
> >      applet.foo();
> >
> > foo is a custom property, as described by Pitfall #4 in
> > http://www.oreillynet.com/lpt/a/6257 .
> >
> > This ugly hack should work:
> >
> > function callApplet() {
> >   location.href = "javascript:(function(){
> > document.getElementById('TestApplet').foo(); })();";
> > }
> >
> > The linked article explains the security reasons for this.
> > _______________________________________________
> > Greasemonkey mailing list
> > Greasemonkey at mozdev.org
> > http://mozdev.org/mailman/listinfo/greasemonkey
> _______________________________________________
> Greasemonkey mailing list
> Greasemonkey at mozdev.org
> http://mozdev.org/mailman/listinfo/greasemonkey
>


More information about the Greasemonkey mailing list