Commit 4195dec5 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame 🎃 Committed by richard
Browse files

fixup! Bug 41435: Add a Tor Browser migration function

Bug 42283: Remove blockchair
parent 116e6f82
Loading
Loading
Loading
Loading
+19 −1
Original line number Diff line number Diff line
@@ -4576,7 +4576,9 @@ BrowserGlue.prototype = {
    //            migration to packaged locales.
    // Version 2: Tor Browser 13.0/13.0a1: tor-browser#41845. Also, removed some
    //            torbutton preferences that are not used anymore.
    const TBB_MIGRATION_VERSION = 2;
    // Version 3: Tor Browser 13.0.7/13.5a3: Remove blockchair
    //            (tor-browser#42283).
    const TBB_MIGRATION_VERSION = 3;
    const MIGRATION_PREF = "torbrowser.migration.version";

    // If we decide to force updating users to pass through any version
@@ -4628,6 +4630,22 @@ BrowserGlue.prototype = {
        }
      }
    }
    if (currentVersion < 3) {
      (async () => {
        try {
          const engine = await lazy.AddonManager.getAddonByID(
            "blockchair@search.mozilla.org"
          );
          await engine?.uninstall();
        } catch {}
        try {
          const engine = await lazy.AddonManager.getAddonByID(
            "blockchair-onion@search.mozilla.org"
          );
          engine?.uninstall();
        } catch {}
      })();
    }

    Services.prefs.setIntPref(MIGRATION_PREF, TBB_MIGRATION_VERSION);
  },