passing arbitrary object when opening window with windowwatcher

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

passing arbitrary object when opening window with windowwatcher

Axel-48
Hello

I'd rather to give my window a JS object and not an array/nsIArray and i'm trying to use
the trick described at https://developer.mozilla.org/en-
US/docs/Working_with_windows_in_chrome_code#Example_5.3A_Using_nsIWindowWatcher_for_passi
ng_an_arbritrary_JavaScript_object but it seems it does not work anymore (I'm using
Xulrunner 22)
The window.argument is a "[xpconnect wrapped nsISupports]" object, and window.argument[0]
is too. I tried to unwrap() this object without success. I m not used to handle XPConnect
or XPCOM so I m a bit lost. So, how could I pass a JS object when opening a window with
windowwatcher ?

Thanks for your help

Une messagerie gratuite, garantie à vie et des services en plus, ça vous tente ?
Je crée ma boîte mail www.laposte.net
_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul
Reply | Threaded
Open this post in threaded view
|

Re: passing arbitrary object when opening window with windowwatcher

Neil-4
[hidden email] wrote:

>I'd rather to give my window a JS object and not an array/nsIArray and i'm trying to use the trick described at https://developer.mozilla.org/en-US/docs/Working_with_windows_in_chrome_code#Example_5.3A_Using_nsIWindowWatcher_for_passing_an_arbritrary_JavaScript_object but it seems it does not work anymore (I'm using Xulrunner 22)
>The window.argument is a "[xpconnect wrapped nsISupports]" object, and window.argument[0] is too. I tried to unwrap() this object without success.
>
The document you linked to said to use .wrappedJSObject, not unwrap().

--
Warning: May contain traces of nuts.
_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul
Reply | Threaded
Open this post in threaded view
|

Re: passing arbitrary object when opening window with windowwatcher

Axel-48
I tried wrappedJSObject too, but did not work, until I read again the
doc, and notice that I skipped the most important line from the
example : args.wrappedJSObject = args;

Sorry for inconvenience and thanks for your answer.

2013/8/6 Neil <[hidden email]>:

> [hidden email] wrote:
>
>> I'd rather to give my window a JS object and not an array/nsIArray and i'm
>> trying to use the trick described at
>> https://developer.mozilla.org/en-US/docs/Working_with_windows_in_chrome_code#Example_5.3A_Using_nsIWindowWatcher_for_passing_an_arbritrary_JavaScript_object
>> but it seems it does not work anymore (I'm using Xulrunner 22)
>>
>> The window.argument is a "[xpconnect wrapped nsISupports]" object, and
>> window.argument[0] is too. I tried to unwrap() this object without success.
>>
> The document you linked to said to use .wrappedJSObject, not unwrap().
>
> --
> Warning: May contain traces of nuts.
>
> _______________________________________________
> dev-tech-xul mailing list
> [hidden email]
> https://lists.mozilla.org/listinfo/dev-tech-xul
_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul