to get the domDocumen, you must load the web page like this :
"nsresult navrv
=webNav->LoadURI(NS_ConvertASCIItoUCS2(url).get(),nsIWebNavigation::LOAD_FLA
GS_NONE,
nsnull, nsnull,
nsnull);"
And then, you must register and implement a nsiWebBrowserChrome listener :
inside your nsiWebBrowerChrome, you will be able to
test the end of loading and finally get the domDocument.
--
B�atrice Philippe
[EMAIL PROTECTED]
"yueweng" <[EMAIL PROTECTED]> a �crit dans le message de
news:[EMAIL PROTECTED]
> Dear all,
>
> I am wondering how do I get the instance of current browser,
> mWebBrower or webNav (see below). My code current hook on Mozilla.exe
> using nsIWebProgressListener? I would like to use the browser
> instance to do the following:
>
> nsCOMPtr<nsIWebNavigation> webNav(do_QueryInterface(mWebBrower));
> nsCOMPtr<nsIDOMDocument> domDocument;
> webNav->GetDocument(getter_AddRefs(domDocument));
> nsCOMPtr<nsIDOMHTMLDocument>
> htmlDomDocument(do_QueryInterface(domDocument));
> nsString title;
> res = htmlDomDocument->GetTitle(title);
>
> Regards,
> yueweng
_______________________________________________
mozilla-embedding mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-embedding