ma1 pushed to branch tor-browser-115.1.0esr-13.0-1 at The Tor Project / Applications / Tor Browser
Commits:
- 
4459daa5
by hackademix at 2023-08-21T11:07:43+02:00
- 
b6f6eb79
by hackademix at 2023-08-21T11:07:44+02:00
- 
80c57ed8
by hackademix at 2023-08-21T11:08:16+02:00
1 changed file:
Changes:
| 1 | 1 |  "use strict";
 | 
| 2 | 2 | |
| 3 | -var EXPORTED_SYMBOLS = ["NewIdentityButton"];
 | |
| 4 | - | |
| 5 | 3 |  /* globals CustomizableUI Services gFindBarInitialized gFindBar
 | 
| 6 | 4 |     OpenBrowserWindow PrivateBrowsingUtils XPCOMUtils
 | 
| 7 | 5 |   */
 | 
| ... | ... | @@ -144,6 +142,7 @@ XPCOMUtils.defineLazyGetter(this, "NewIdentityButton", () => { | 
| 144 | 142 |        this.clearStorage();
 | 
| 145 | 143 |        this.clearPreferencesAndPermissions();
 | 
| 146 | 144 |        await this.clearData();
 | 
| 145 | +      await this.reloadAddons();
 | |
| 147 | 146 |        this.clearConnections();
 | 
| 148 | 147 |        this.clearPrivateSession();
 | 
| 149 | 148 |      }
 | 
| ... | ... | @@ -160,7 +159,6 @@ XPCOMUtils.defineLazyGetter(this, "NewIdentityButton", () => { | 
| 160 | 159 |      }
 | 
| 161 | 160 | |
| 162 | 161 |      closeTabs() {
 | 
| 163 | -      logger.info("Closing tabs");
 | |
| 164 | 162 |        if (
 | 
| 165 | 163 |          !Services.prefs.getBoolPref("browser.new_identity.close_newnym", true)
 | 
| 166 | 164 |        ) {
 | 
| ... | ... | @@ -414,6 +412,15 @@ XPCOMUtils.defineLazyGetter(this, "NewIdentityButton", () => { | 
| 414 | 412 |        Services.obs.notifyObservers(null, "last-pb-context-exited");
 | 
| 415 | 413 |      }
 | 
| 416 | 414 | |
| 415 | +    async reloadAddons() {
 | |
| 416 | +      logger.info("Reloading add-ons to clear their temporary state.");
 | |
| 417 | +      // Reload all active extensions except search engines, which would throw.
 | |
| 418 | +      const addons = (
 | |
| 419 | +        await AddonManager.getAddonsByTypes(["extension"])
 | |
| 420 | +      ).filter(a => a.isActive && !a.id.endsWith("@search.mozilla.org"));
 | |
| 421 | +      await Promise.all(addons.map(a => a.reload()));
 | |
| 422 | +    }
 | |
| 423 | + | |
| 417 | 424 |      // Broadcast as a hook to clear other data
 | 
| 418 | 425 | |
| 419 | 426 |      broadcast() {
 |