[tbb-commits] [Git][tpo/applications/tor-browser][tor-browser-115.1.0esr-13.0-1] 3 commits: fixup! Bug 40926: Implemented the New Identity feature

ma1 (@ma1) git at gitlab.torproject.org
Mon Aug 21 12:25:26 UTC 2023



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
fixup! Bug 40926: Implemented the New Identity feature

Remove useless and confusing EXPORTED_SYMBOLS usage in ScriptLoader inclusion.

- - - - -
b6f6eb79 by hackademix at 2023-08-21T11:07:44+02:00
fixup! Bug 40926: Implemented the New Identity feature

Remove redundant "Closing tabs" logging.

- - - - -
80c57ed8 by hackademix at 2023-08-21T11:08:16+02:00
fixup! Bug 40926: Implemented the New Identity feature

Bug 41833: Reload extensions on new identity

- - - - -


1 changed file:

- browser/components/newidentity/content/newidentity.js


Changes:

=====================================
browser/components/newidentity/content/newidentity.js
=====================================
@@ -1,7 +1,5 @@
 "use strict";
 
-var EXPORTED_SYMBOLS = ["NewIdentityButton"];
-
 /* globals CustomizableUI Services gFindBarInitialized gFindBar
    OpenBrowserWindow PrivateBrowsingUtils XPCOMUtils
  */
@@ -144,6 +142,7 @@ XPCOMUtils.defineLazyGetter(this, "NewIdentityButton", () => {
       this.clearStorage();
       this.clearPreferencesAndPermissions();
       await this.clearData();
+      await this.reloadAddons();
       this.clearConnections();
       this.clearPrivateSession();
     }
@@ -160,7 +159,6 @@ XPCOMUtils.defineLazyGetter(this, "NewIdentityButton", () => {
     }
 
     closeTabs() {
-      logger.info("Closing tabs");
       if (
         !Services.prefs.getBoolPref("browser.new_identity.close_newnym", true)
       ) {
@@ -414,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() {



View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/39d95c675acefa5ff643d055832093b37b2cffd3...80c57ed87e50c7c95b1c8a51bc68250e4410f192

-- 
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/39d95c675acefa5ff643d055832093b37b2cffd3...80c57ed87e50c7c95b1c8a51bc68250e4410f192
You're receiving this email because of your account on gitlab.torproject.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/tbb-commits/attachments/20230821/b4bd6737/attachment-0001.htm>


More information about the tbb-commits mailing list