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

ma1 (@ma1) git at gitlab.torproject.org
Fri Oct 20 13:47:03 UTC 2023



ma1 pushed to branch mullvad-browser-115.4.0esr-13.0-1 at The Tor Project / Applications / Mullvad Browser


Commits:
7898b29a by hackademix at 2023-10-20T15:46:41+02:00
fixup! Bug 40926: Implemented the New Identity feature

Bug 42182: avoid reloading any search engine extension.

- - - - -


1 changed file:

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


Changes:

=====================================
browser/components/newidentity/content/newidentity.js
=====================================
@@ -415,10 +415,13 @@ XPCOMUtils.defineLazyGetter(this, "NewIdentityButton", () => {
     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()));
+      const addons = await AddonManager.getAddonsByTypes(["extension"]);
+      const isSearchEngine = async addon =>
+        (await (await fetch(addon.getResourceURI("manifest.json").spec)).json())
+          ?.chrome_settings_overrides?.search_provider;
+      const reloadIfNeeded = async addon =>
+        addon.isActive && !(await isSearchEngine(addon)) && addon.reload();
+      await Promise.all(addons.map(addon => reloadIfNeeded(addon)));
     }
 
     // Broadcast as a hook to clear other data



View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/7898b29ae230f55339ce4db8d2e4b60585fc6c3e

-- 
View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/7898b29ae230f55339ce4db8d2e4b60585fc6c3e
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/tor-commits/attachments/20231020/8150e983/attachment-0001.htm>


More information about the tor-commits mailing list