Source code

Revision control

Copy as Markdown

Other Tools

/**
* Any copyright is dedicated to the Public Domain.
*/
import {
getCachedUsageForOrigin,
resetStorage,
export const Utils = {
async getCachedOriginUsage() {
const principal = Cc["@mozilla.org/systemprincipal;1"].createInstance(
Ci.nsIPrincipal
);
const result = await getCachedUsageForOrigin(principal);
return result;
},
async shrinkStorageSize(size) {
Services.prefs.setIntPref(
"dom.quotaManager.temporaryStorage.fixedLimit",
size
);
const result = await resetStorage();
return result;
},
async restoreStorageSize() {
Services.prefs.clearUserPref(
"dom.quotaManager.temporaryStorage.fixedLimit"
);
const result = await resetStorage();
return result;
},
};