[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



commit fe77759e2e3227344bb7dec64cf58fccd596c497
Author: Alex Catarineu <acat@xxxxxxxxxxxxxx>
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@xxxxxxx"]);
 
 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.



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits