offlineAppCache.jsm 733 B

123456789101112131415161718192021
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  4. this.EXPORTED_SYMBOLS = ["OfflineAppCacheHelper"];
  5. Components.utils.import('resource://gre/modules/LoadContextInfo.jsm');
  6. const Cc = Components.classes;
  7. const Ci = Components.interfaces;
  8. this.OfflineAppCacheHelper = {
  9. clear: function() {
  10. var cacheService = Cc["@mozilla.org/netwerk/cache-storage-service;1"].getService(Ci.nsICacheStorageService);
  11. var appCacheStorage = cacheService.appCacheStorage(LoadContextInfo.default, null);
  12. try {
  13. appCacheStorage.asyncEvictStorage(null);
  14. } catch(er) {}
  15. }
  16. };