@ https://developer.mozilla.org/en/XPCNativeWrapper
The following would not create trusted windows:

   - <xul:browser type="content">     *//Your case!*
   - <xul:iframe type="content-primary">

So you should call your variable using XPCNativeWrapper & wrappedJSObject

Something like this should works fine:

*Var win = document.getElementById('Br').contentWindow;
var contentWinWrapper = new XPCNativeWrapper(win);
contentWinWrapper.wrappedJSObject.ad;*

-InBasic


On Mon, Mar 9, 2009 at 10:05, joe ertaba <[email protected]> wrote:

> OK, thanks it works now! but there is more baffling think happens
>
> document.getElementById("Br).contentWindow.ad; works when I test it with
> "extension developer extension" on XUL editor
> but when I try to use exactly the same on XULRunner it doesn't work and
> here is the warning:
>
> Warning: reference to undefined property
> document.getElementById("Br").contentWindow.ad
> Source File: chrome://..../content/main.xul
> Line: 1
>
> Also I try to lunch application using Firefox (-app) and the same warning
> occurs
>
>
>
> On Mon, Mar 9, 2009 at 3:29 AM, Zachary Carter <[email protected]>wrote:
>
>> Try contentWindow instead of contentDocument
>> --
>> Zach Carter
>> http://zach.carter.name
>>
>>
>>
>> On Sun, Mar 8, 2009 at 10:39 AM, joe ertaba <[email protected]> wrote:
>> > Hi
>> >
>> > I use Browser element to show a local html file
>> >
>> > my html file
>> > ...
>> > <script type="text/javascript">
>> > var ad = "fff";
>> > </script>
>> > ....
>> >
>> >
>> > <browser type="content" id="Br" src="...." flex="1"/>
>> >
>> >
>> > Now I want to call a variable ('ad') in html
>> >
>> > It should be something like this:
>> >
>> > document.getElementById("Br).contentDocument.da;
>> >
>> > But it doesn't work, can anybody help?
>> > Joe
>> >
>> > _______________________________________________
>> > Project_owners mailing list
>> > [email protected]
>> > https://www.mozdev.org/mailman/listinfo/project_owners
>> >
>> >
>> _______________________________________________
>> Project_owners mailing list
>> [email protected]
>> https://www.mozdev.org/mailman/listinfo/project_owners
>>
>
>
> _______________________________________________
> Project_owners mailing list
> [email protected]
> https://www.mozdev.org/mailman/listinfo/project_owners
>
>
_______________________________________________
Project_owners mailing list
[email protected]
https://www.mozdev.org/mailman/listinfo/project_owners

Reply via email to