Skip to content
Snippets Groups Projects
Verified Commit 0537009f authored by ma1's avatar ma1
Browse files

fixup! Bug 40926: Implemented the New Identity feature

Bug 41833: Reload extensions on new identity
parent a2098747
Branches
No related tags found
No related merge requests found
......@@ -142,6 +142,7 @@ XPCOMUtils.defineLazyGetter(this, "NewIdentityButton", () => {
this.clearStorage();
this.clearPreferencesAndPermissions();
await this.clearData();
await this.reloadAddons();
this.clearConnections();
this.clearPrivateSession();
}
......@@ -411,6 +412,15 @@ XPCOMUtils.defineLazyGetter(this, "NewIdentityButton", () => {
Services.obs.notifyObservers(null, "last-pb-context-exited");
}
async reloadAddons() {
logger.info("Reloading add-ons to clear their temporary state.");
// Reload all active extensions except search engines, which would throw.
const addons = (
await AddonManager.getAddonsByTypes(["extension"])
).filter(a => a.isActive && !a.id.endsWith("@search.mozilla.org"));
await Promise.all(addons.map(a => a.reload()));
}
// Broadcast as a hook to clear other data
broadcast() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment