Re: How to get nsIWebBrowser interface from a component?

Doug Turner <[email protected]>
Newsgroups gmane.comp.mozilla.devel.xpcom
Organization Another Netscape Collabra Server User
Message-ID <[email protected]>
Jacob Wong wrote:
> I have tried to get the nsIWebBrowser using the following code
> nsCOMPtr<nsIWebBrowser>
> pBrowser2(do_GetService("@mozilla.org/embedding/browser/nsWebBrowser;1"));
> nsCOMPtr<nsIWebNavigation> spIWebNavigation1 = do_QueryInterface(pBrowser2);
> nsCOMPtr<nsIURI> newUri;
> res = NS_NewURI(getter_AddRefs(newUri), sUrl);
> res = spIWebNavigation1->LoadURI(sUrl.get(),
> nsIWebNavigation::LOAD_FLAGS_NONE);
> 
> However, Netscape 6.2.x does not load the new url.  the return value is
> 0x8000ffff.  That is unexpected error.  I also try to use
> 
> res = spIWebNavigation1->GoBack();
> 
> Netscape 6.2.x  does not go back to the previous page.
> 
> Any idea what I have done wrong here?
> 

At what point do you make this call?  In your registerSelf callback?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.