Hi,

I have an interface (which has nsIClassInfo.flags =
nsIClassInfo.DOM_OBJECT) which is registered as a JavaScript global
property with nsICategoryManager, which means an instance is created
for each window/tab and injected into that window/tab's window object
(e.g. window.myObject).

When the instance is injected into the window object, its factory is
called, which calls the constructor.  What I want to know is: is there
a way to get a reference to the window object which my object is being
injected into in the factory/constructor? I want to do this so I can
access the DOM of the page my object is injected into.

Could I do this through nsIWindowMediator.getMostRecentWindow()?  If
so, is this guaranteed to return the correct window? (i.e. is this
threadsafe?)

Cheers,

Bruce

_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom

Reply via email to