The lines you want are:
nsIServiceManager serviceManager =
Mozilla.getInstance().getServiceManager();
nsIFaviconService service =
(nsIFaviconService)serviceManager.getServiceByContractID("@mozilla.org/brows
er/favicon-service;1", nsIFaviconService.NS_IFAVICONSERVICE_IID);
If you're asking which services should be accessed in this manner, I think
the answer is all of them. I don't know if there's a list of all available
services.
HTH,
Grant
"Steve Sobol" <[email protected]> wrote in message
news:[email protected]...
> In article <[email protected]>,
> [email protected] says...
> >
> > Steve Sobol wrote:
> > > I'm embedding Mozilla into a Java app using XULRunner 1.9.2, and I am
> > > looking for a web page's favicon... so I do this:
> > >
> > >
> > > nsIFaviconService fave = (nsIFaviconService)webBrowser.
> > > queryInterface(nsIFaviconService.NS_IFAVICONSERVICE_IID);
> >
> > The webbrowser object doesn't implement nsIFaviconService. You need to
> > get it from the service manager with the contract ID
> > "@mozilla.org/browser/favicon-service;1".
>
> Ah! Thank you! Two questions:
>
> ** Is there a list of services that must be accessed this way, and
>
> (forgive me, I just started playing around with JavaXPCOM) can you give
> me a 2- or 3-line sample that will give me the FaviconService interface
> using that contract ID?
>
> Thanks a bunch for helping this newbie...
>
> Best,
> Steve
>
>
> --
> Steve Sobol, Victorville, California, USA
> [email protected]
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding