Re: How to get nsIWebBrowser interface from a component?
"Jacob Wong" <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.xpcom |
|---|---|
| Organization | Another Netscape Collabra Server User |
| Message-ID | <[email protected]> |
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?
Jacob Wong
"Pete Collins" <[email protected]> wrote in message
news:[email protected]...
> Jacob Wong wrote:
> > Hi
> >
> > Is that possible to write a component and retrieve the nsIWebBrowser
> > interface? More or less like the BHO in IE. If component is not the
> > correct approach, anyone know is there a way to do it?
>
>
> Sure a component can implement any other component.
> nsIWebBrowser is accessable from js or C++.
>
> The world is your oyster in mozilla. ;-)
>
> --pete
>