X
Tap here to go to the mobile version of the site.
Your Firefox is out of date and may contain a security risk! Upgrade Firefox

Support Forum

Delete cookie without exception

Posted

I created own firefox extension that remove all firefox cookies.

this is code:

Components.classes["@mozilla.org/cookiemanager;1"]

     .getService(Components.interfaces.nsICookieManager).removeAll();

How can I remove all cookies without one site exception with cookie manager function?

Additional System Details

Application

  • User Agent: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.33 (KHTML, like Gecko) Chrome/27.0.1430.3 Safari/537.33

More Information

jscher2000
  • Top 10 Contributor
2365 solutions 20922 answers

I only see two methods there: remove and removeAll: https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsICookieManager

Perhaps you could save the details of the cookie you do not want to delete and use either add or import to restore it after you removeAll?

https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsICookieManager2

Question owner

Can You write function wchich will save one exception and add it after delete all? ;)

jscher2000
  • Top 10 Contributor
2365 solutions 20922 answers

Not me personally, sorry.

Question owner

Could someone help?

jscher2000
  • Top 10 Contributor
2365 solutions 20922 answers

Or, since this isn't really a support question, try the mozillaZine Extension Development forum.