[Greasemonkey] GM & JavaScript/Applet Interaction

Jesse Merriman jessemerriman at warpmail.net
Sat Oct 14 20:24:13 PDT 2006


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


More information about the Greasemonkey mailing list