Dear all,

I have implement nsIWebProgressListener then OnStateChange() is
successfully called.

However, I try to do the following code inside OnStateChange() but
domDocument is always NULL.  I don't understand why.  Please enlighten
me if anyone have any idea?


OnStateChange(..........)
{
if((progressStateFlags & STATE_IS_DOCUMENT)&&(progressStateFlags &
STATE_STOP))
{

  nsCOMPtr<nsIWebBrowser> pBrowser(do_GetService
("@mozilla.org/embedding/browser/nsWebBrowser;1"));
  nsCOMPtr<nsIWebNavigation> webNav = do_QueryInterface(pBrowser); 
  nsCOMPtr<nsIDOMDocument> domDocument;
  webNav->GetDocument(getter_AddRefs(domDocument));
  nsCOMPtr<nsIDOMHTMLDocument>
htmlDomDocument(do_QueryInterface(domDocument));

  if(domDocument)//<--------------always NULL
  {
    nsString title;
    htmlDomDocument->GetTitle(title);
    printf("Parse_URL() - Document title = %s\n",
ToNewUTF8String(title));
  }

}//end if
}//end OnStateChange(........)

Regards,
YueWeng
_______________________________________________
mozilla-embedding mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-embedding

Reply via email to