[tbb-commits] [tor-browser/tor-browser-83.0b1-10.0-1] fixup! Bug 40091: Load HTTPS Everywhere as a builtin addon in desktop

sysrqb at torproject.org sysrqb at torproject.org
Wed Nov 4 21:09:24 UTC 2020


commit 49173da07b4f36b503fb1203c0dfb701e44cf376
Author: Matthew Finkel <sysrqb at torproject.org>
Date:   Wed Nov 4 20:57:18 2020 +0000

    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 | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/toolkit/components/extensions/Extension.jsm b/toolkit/components/extensions/Extension.jsm
index 54c8478a686b..8c5b79055186 100644
--- a/toolkit/components/extensions/Extension.jsm
+++ b/toolkit/components/extensions/Extension.jsm
@@ -212,6 +212,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`
@@ -358,7 +359,8 @@ var ExtensionAddonObserver = {
       );
     }
 
-    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)`,
@@ -406,7 +408,8 @@ 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);
     }
@@ -2516,7 +2519,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 tbb-commits mailing list