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
[EMAIL PROTECTED]">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
>



Reply via email to