Get cookie in xulrunner

Source: Internet
Author: User
Recently, I was looking at browser embedding and found xulrunner,
Http://developer.mozilla.org/cn/docs/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6:%E4%BD%BF%E7%94%A8_XPCOM_%E7%BB%84%E4%BB%B6
Create an XPCOM component: Use the XPCOM component

Http://developer.mozilla.org/en/docs/nsICookieManager
Nsicookiemanager

How do I obtain cookies?
Http://dev.eclipse.org/newslists/news.eclipse.platform.swt/msg37871.html

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 ("@ override", 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 wowould love to know.

 
Aaron

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.