summaryrefslogtreecommitdiffstats
path: root/dom/serviceworkers/test/file_js_cache_cleanup.js
blob: c6853faaf2fe18633627aa4ae6eca1646c827472 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
"use strict";
const { XPCOMUtils } = ChromeUtils.importESModule(
  "resource://gre/modules/XPCOMUtils.sys.mjs"
);

function clearCache() {
  const cacheStorageSrv = Cc[
    "@mozilla.org/netwerk/cache-storage-service;1"
  ].getService(Ci.nsICacheStorageService);
  cacheStorageSrv.clear();
}

addMessageListener("teardown", function () {
  clearCache();
  sendAsyncMessage("teardown-complete");
});