Accessing global JavaScript property from DOM
Pekka Vanhoja <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.dom |
|---|---|
| Message-ID | <[email protected]> |
Hi,
I have a xpcom component written in C++ that when registering itself
adds a new entry to JAVASCRIPT_GLOBAL_PROPERTY_CATEGORY and everything
here works just fine.
Now I'm trying to figure out that is there any way to check in my
application that embeds the mozilla engine is the C++ object behind the
global JS property created or not? And if it is created, to get access
to the object itself? Could this be achieved through some DOM
interfaces? Or if this cannot be achieved in the embedding application
level could it be done inside mozilla somehow?
So, in JS:
// Creates the XPCOM C++ object implementing someMethod and calls the
// method
window.myglobalproperty.someMethod();
And in the embedding application something like:
if (/*Check if myglobalproperty object has been created*/)
{
/* Get reference to myglobalproperty some how*/
MyGlobalPropertyImpl* myProp = GetMyGlobalPropertyRef();
}
Thanks for the answers in advance!
BR,
Pekka