summaryrefslogtreecommitdiffstats
path: root/extensions/cookie/test/file_chromecommon.js
blob: 4383876b25b5e337d766c739a45d8c36436cbc6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
let { classes: Cc, utils: Cu, interfaces: Ci } = Components;

let cs = Cc["@mozilla.org/cookiemanager;1"]
           .getService(Ci.nsICookieManager2);

addMessageListener("getCookieCountAndClear", () => {
  let count = 0;
  for (let list = cs.enumerator; list.hasMoreElements(); list.getNext())
    ++count;
  cs.removeAll();

  sendAsyncMessage("getCookieCountAndClear:return", { count });
});

cs.removeAll();