[tor-commits] [tor-browser/tor-browser-78.4.0esr-10.5-1] fixup! Bug 40091: Load HTTPS Everywhere as a builtin addon in desktop

sysrqb at torproject.org sysrqb at torproject.org
Wed Nov 4 20:57:34 UTC 2020


commit fe77759e2e3227344bb7dec64cf58fccd596c497
Author: Alex Catarineu <acat at torproject.org>
Date:   Thu Oct 29 22:03:28 2020 +0100

    fixup! Bug 40091: Load HTTPS Everywhere as a builtin addon in desktop
    
    Fixes #40137: Built-in https-everywhere storage is not migrated to idb
---
 toolkit/components/extensions/Extension.jsm | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/toolkit/components/extensions/Extension.jsm b/toolkit/components/extensions/Extension.jsm
index 876e636be3db..7dbd888b1710 100644
--- a/toolkit/components/extensions/Extension.jsm
+++ b/toolkit/components/extensions/Extension.jsm
@@ -211,6 +211,7 @@ const LOGGER_ID_BASE = "addons.webextension.";
 const UUID_MAP_PREF = "extensions.webextensions.uuids";
 const LEAVE_STORAGE_PREF = "extensions.webextensions.keepStorageOnUninstall";
 const LEAVE_UUID_PREF = "extensions.webextensions.keepUuidOnUninstall";
+const PERSISTENT_EXTENSIONS = new Set(["https-everywhere-eff at eff.org"]);
 
 const COMMENT_REGEXP = new RegExp(
   String.raw`
@@ -331,7 +332,10 @@ var ExtensionAddonObserver = {
       return;
     }
 
-    if (!Services.prefs.getBoolPref(LEAVE_STORAGE_PREF, false)) {
+    if (
+      !Services.prefs.getBoolPref(LEAVE_STORAGE_PREF, false) &&
+      !PERSISTENT_EXTENSIONS.has(addon.id)
+    ) {
       // Clear browser.storage.local backends.
       AsyncShutdown.profileChangeTeardown.addBlocker(
         `Clear Extension Storage ${addon.id} (File Backend)`,
@@ -384,7 +388,10 @@ var ExtensionAddonObserver = {
 
     ExtensionPermissions.removeAll(addon.id);
 
-    if (!Services.prefs.getBoolPref(LEAVE_UUID_PREF, false)) {
+    if (
+      !Services.prefs.getBoolPref(LEAVE_UUID_PREF, false) &&
+      !PERSISTENT_EXTENSIONS.has(addon.id)
+    ) {
       // Clear the entry in the UUID map
       UUIDMap.remove(addon.id);
     }
@@ -2474,7 +2481,8 @@ class Extension extends ExtensionData {
           );
         } else if (
           this.startupReason === "ADDON_INSTALL" &&
-          !Services.prefs.getBoolPref(LEAVE_STORAGE_PREF, false)
+          !Services.prefs.getBoolPref(LEAVE_STORAGE_PREF, false) &&
+          !PERSISTENT_EXTENSIONS.has(this.id)
         ) {
           // If the extension has been just installed, set it as migrated,
           // because there will not be any data to migrate.





More information about the tor-commits mailing list