[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: SWT Browser and JavaXPCOM getting Cookies

Well I got it working, I think I was passing in the wrong ID. Here is the code if anyone else has this problem.

nsIServiceManager serviceManager = Mozilla.getInstance().getServiceManager();
nsICookieManager cookieManager = (nsICookieManager) serviceManager.getServiceByContractID("@mozilla.org/cookiemanager;1", nsICookieManager.NS_ICOOKIEMANAGER_IID);


nsISimpleEnumerator cookieEnumerator = cookieManager.getEnumerator();

while (cookieEnumerator.hasMoreElements()) {
// Not sure how to get the nsICookie Object.
nsICookie cookie = (nsICookie)cookieEnumerator.getNext().queryInterface(nsICookie.NS_ICOOKIE_IID);
System.out.println(cookie.getName());
System.out.println(cookie.getHost());
}


If anyone has a place to gather more information for using the JavaXPCOM other than the XUL Planet site I would love to know.

Aaron