gecko-dev/netwerk/test/mochitests/file_chromecommon.js

18 строки
358 B
JavaScript

/* eslint-env mozilla/frame-script */
"use strict";
let cs = Cc["@mozilla.org/cookiemanager;1"].getService(Ci.nsICookieManager);
addMessageListener("getCookieCountAndClear", () => {
let count = 0;
for (let cookie of cs.cookies) {
++count;
}
cs.removeAll();
sendAsyncMessage("getCookieCountAndClear:return", { count });
});
cs.removeAll();