Hello,
I am developing an XP-COM, which implements nsIObserver interface to
listen to the 'domwindowopened' notification. Everytime when the user
opens a new browser window, I can obtain its nsIDOMWindow interface and
save it somewhere:
NS_IMETHODIMP
MyComponent::Observe(
nsISupports *aSubject,
const char *aTopic,
const PRUnichar *aData
)
{
nsresult rv;
if (aTopic && strcmp(aTopic, "domwindowopened") == 0) {
nsCOMPtr<nsIDOMWindow> pDOMWindow = nsnull;
pDOMWindow = do_QueryInterface(aSubject, &rv);
RememberThisDOMWindow(pDOMWindow);
}
....
}
My component also implements the nsIWebProgressListener interface, and
when the user browses the web, I get noticed:
NS_IMETHODIMP
MyComponent::OnStateChange(
nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
PRUint32 aStateFlags,
nsresult aStatus
)
{
.....
}
The question is: how can I determine, within the
MyComponent::OnStateChange method, in which browser window (from the
list I have obtained before) the web-browsing process is taking place?
Thanks alot in advance for any help.
VONUYX
_______________________________________________
Mozilla-xpcom mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-xpcom