зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1047098 - "Clear Recent History" must clean up all the ServiceWorkers, r=bkelly
This commit is contained in:
Родитель
c4d20beb84
Коммит
ebcdb2c6b8
|
@ -20,6 +20,9 @@ XPCOMUtils.defineLazyModuleGetters(this, {
|
|||
});
|
||||
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "serviceWorkerManager",
|
||||
"@mozilla.org/serviceworkers/manager;1",
|
||||
"nsIServiceWorkerManager");
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "quotaManagerService",
|
||||
"@mozilla.org/dom/quota-manager-service;1",
|
||||
"nsIQuotaManagerService");
|
||||
|
@ -293,6 +296,14 @@ Sanitizer.prototype = {
|
|||
// LocalStorage
|
||||
Services.obs.notifyObservers(null, "extension:purge-localStorage");
|
||||
|
||||
// ServiceWorkers
|
||||
let serviceWorkers = serviceWorkerManager.getAllRegistrations();
|
||||
for (let i = 0; i < serviceWorkers.length; i++) {
|
||||
let sw = serviceWorkers.queryElementAt(i, Ci.nsIServiceWorkerRegistrationInfo);
|
||||
let host = sw.principal.URI.host;
|
||||
serviceWorkerManager.removeAndPropagate(host);
|
||||
}
|
||||
|
||||
// QuotaManager
|
||||
let promises = [];
|
||||
await new Promise(resolve => {
|
||||
|
|
|
@ -75,7 +75,7 @@ XPCOMUtils.defineLazyGetter(this, "SMALLSVG_DATA_URI", function() {
|
|||
var gTestDir = do_get_cwd();
|
||||
|
||||
// Initialize profile.
|
||||
var gProfD = do_get_profile();
|
||||
var gProfD = do_get_profile(true);
|
||||
|
||||
Services.prefs.setBoolPref("browser.urlbar.usepreloadedtopurls.enabled", false);
|
||||
do_register_cleanup(() =>
|
||||
|
|
Загрузка…
Ссылка в новой задаче