Try this:

   var win = CmdUtils.getWindowInsecure();
   win.myfunction();


Which is the same as:

   var win = 
Application.activeWindow.activeTab.document.defaultView.wrappedJSObject;
win.myfunction();



- Blair




On 22/11/2008 8:06 AM, Douglas Nogueira wrote:
> I'm trying to do this:
>
> myTab.focus()
> var string =
> Application.activeWindow.activeTab.wrappedJSObject.document.myfunction();
> displayMessage(string);
>
>
> Don't show anything!!
>
> In the web site i have this in js:
>
> function myfunction(){
> return "oi";
> }
>
> There is something wrong? That is the only way to call js functions in
> the current document ?
>
>
>
> 2008/11/8 rpl <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>
>
>
>     In firefox3 content DOM objects are wrapped with a XPCNativeWrapper
>     interface for security reason:
>
>     http://developer.mozilla.org/en/XPCNativeWrapper
>
>     To access customized javascript functions (from the above link):
>
>     If unsafe access to a property is required for some reason, this can
>     be accomplished via the wrappedJSObject property of the wrapper.
>
>
>     So you can try something like this:
>
>     
> Application.activeWindow.activeTab.wrappedJSObject.document.myfunction("hello
>     world");
>
>     Or something like this ;-)
>
>     Happy Hacking,
>     Luca Greco @ Alca Società Cooperativa
>
>
>
> >

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"ubiquity-firefox" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/ubiquity-firefox?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to