How to get a nsIPrivateBrowsingService reference in Java?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to get a nsIPrivateBrowsingService reference in Java?

gbobeff
This post has NOT been accepted by the mailing list yet.
Hi,

I'm trying to get a reference to the nsIPrivateBrowsingService from a webBrowser instance in Java.
But i don't know how.
I've tried from a nsIWebBrowser instace like this

nsIWebBrowser webBrowser = (nsIWebBrowser) browser.getWebBrowser();
nsIPrivateBrowsingService pbs= (nsIPrivateBrowsingService)((nsIInterfaceRequestor) webBrowser
                                .queryInterface(nsIInterfaceRequestor.NS_IINTERFACEREQUESTOR_IID))
                                .getInterface(nsIPrivateBrowsingService.NS_IPRIVATEBROWSINGSERVICE_IID);

I've also tried from a  nsIDOMWindow and nsIServiceManager instance but i've obtained always these message :

"org.mozilla.xpcom.XPCOMException: The function "getInterface" returned an error condition  (0x80004002)"

Any idea?

Thanks

-- Gustavo
Loading...