morgan pushed to branch tor-browser-153.0esr-16.0-1 at The Tor Project / Applications / Tor Browser Commits: fa075e61 by Pier Angelo Vendrame at 2026-08-06T16:09:00+00:00 fixup! BB 42027: Base Browser migration procedures. BB 45039: Make it easier to test ProfileDataUpgrader customization. - - - - - 8f8c3495 by Pier Angelo Vendrame at 2026-08-06T16:09:00+00:00 amend! TB 41435: Add a Tor Browser migration function TB 41435: Add a Tor Browser migration function - - - - - 1 changed file: - browser/components/ProfileDataUpgrader.sys.mjs Changes: ===================================== browser/components/ProfileDataUpgrader.sys.mjs ===================================== @@ -1026,7 +1026,15 @@ export let ProfileDataUpgrader = { Services.prefs.setIntPref("browser.migration.version", newVersion); }, - upgradeBB(isNewProfile) { + /** + * Run the profile data migration for Base Browser if needed. + * + * @param {boolean} isNewProfile When true, just set the migration version + * without actually changing anything. + * @param {number} [currentVersion] The version to migrating from. To be used + * only by tests. + */ + upgradeBB(isNewProfile, currentVersion) { // Version 1: 13.0a3. Reset layout.css.prefers-color-scheme.content-override // for tor-browser#41739. // Version 2: 14.0a5: Reset the privacy tracking headers preferences since @@ -1056,7 +1064,10 @@ export let ProfileDataUpgrader = { console.error("upgradeBB: isNewProfile is undefined."); } - const currentVersion = Services.prefs.getIntPref(MIGRATION_PREF, 0); + if (currentVersion === undefined) { + currentVersion = Services.prefs.getIntPref(MIGRATION_PREF, 0); + } + if (currentVersion < 1) { Services.prefs.clearUserPref( "layout.css.prefers-color-scheme.content-override" @@ -1163,7 +1174,15 @@ export let ProfileDataUpgrader = { Services.prefs.setIntPref(MIGRATION_PREF, MIGRATION_VERSION); }, - async upgradeTB(isNewProfile) { + /** + * Run the profile data migration for Tor Browser if needed. + * + * @param {boolean} isNewProfile When true, just set the migration version + * without actually changing anything. + * @param {number} [currentVersion] The version to migrating from. To be used + * only by tests. + */ + async upgradeTB(isNewProfile, currentVersion) { // Version 1: Tor Browser 12.0. We use it to remove langpacks, after the // migration to packaged locales. // Version 2: Tor Browser 13.0/13.0a1: tor-browser#41845. Also, removed some @@ -1199,7 +1218,10 @@ export let ProfileDataUpgrader = { console.error("upgradeTB: isNewProfile is undefined."); } - const currentVersion = Services.prefs.getIntPref(MIGRATION_PREF, 0); + if (currentVersion === undefined) { + currentVersion = Services.prefs.getIntPref(MIGRATION_PREF, 0); + } + const removeLangpacks = async () => { for (const addon of await AddonManager.getAddonsByTypes(["locale"])) { await addon.uninstall(); View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/53206cf... -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/53206cf... You're receiving this email because of your account on gitlab.torproject.org. Manage all notifications: https://gitlab.torproject.org/-/profile/notifications | Help: https://gitlab.torproject.org/help
participants (1)
-
morgan (@morgan)