Are you trying to embed gecko or write an extension? I am not sure you
would use the same code in both cases.
When developing an extension, I do it the following way:
Inherit from nsIWebProgressListener and listen for document load
events.
Then inside:
OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32
aStateFlags, nsresult aStatus) {
...
nsCOMPtr<nsIDOMWindow> window;
rv = aWebProgress->GetDOMWindow(getter_AddRefs(window));
if (NS_FAILED(rv))
return rv;
nsCOMPtr<nsIDOMDocument> domDoc;
rv = window->GetDocument(getter_AddRefs(domDoc));
if (NS_FAILED(rv))
return rv;
nsCOMPtr<nsIDOMHTMLDocument> htmlDoc = do_QueryInterface(domDoc);
if (!htmlDoc)
return NS_OK;
...
}
I've never tried embedding gecko so if that's what you're trying to do
someone else will have to help you.
Regards,
Giorgos
_______________________________________________
Mozilla-xpcom mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-xpcom