David Bradley wrote: > Kok Hoor , SolutionX wrote: > >> Hi, >> >> I am only getting an nsISupports as the subject when the observers >> receive the notification. My question is, how should I QueryInterface on >> the subject to retrieve either a: >> >> 1. Javascript object >> 2. Javascript array >> > > > If I understand you correctly, you'll need to QI to > nsIXPConnectJSObjectHolder and then access the JSObject property via > GetJSObject. That will give you a JSObject*. Are you looking for > JSObject pointer?
It sounds to me like the goal is to do this from JS code rather than native code. If that is the case then the 'wrappedJSObject' scheme is the appropriate solution. Read closely the rambling comment at: http://lxr.mozilla.org/seamonkey/source/js/src/xpconnect/idl/nsIXPConnect.idl#225 And look at a couple of examples in .js and .html files here: http://lxr.mozilla.org/seamonkey/search?string=wrappedJSObject John. > > David >
