| ... |
... |
@@ -1026,7 +1026,15 @@ export let ProfileDataUpgrader = { |
|
1026
|
1026
|
Services.prefs.setIntPref("browser.migration.version", newVersion);
|
|
1027
|
1027
|
},
|
|
1028
|
1028
|
|
|
1029
|
|
- upgradeBB(isNewProfile) {
|
|
|
1029
|
+ /**
|
|
|
1030
|
+ * Run the profile data migration for Base Browser if needed.
|
|
|
1031
|
+ *
|
|
|
1032
|
+ * @param {boolean} isNewProfile When true, just set the migration version
|
|
|
1033
|
+ * without actually changing anything.
|
|
|
1034
|
+ * @param {number} [currentVersion] The version to migrating from. To be used
|
|
|
1035
|
+ * only by tests.
|
|
|
1036
|
+ */
|
|
|
1037
|
+ upgradeBB(isNewProfile, currentVersion) {
|
|
1030
|
1038
|
// Version 1: 13.0a3. Reset layout.css.prefers-color-scheme.content-override
|
|
1031
|
1039
|
// for tor-browser#41739.
|
|
1032
|
1040
|
// Version 2: 14.0a5: Reset the privacy tracking headers preferences since
|
| ... |
... |
@@ -1056,7 +1064,10 @@ export let ProfileDataUpgrader = { |
|
1056
|
1064
|
console.error("upgradeBB: isNewProfile is undefined.");
|
|
1057
|
1065
|
}
|
|
1058
|
1066
|
|
|
1059
|
|
- const currentVersion = Services.prefs.getIntPref(MIGRATION_PREF, 0);
|
|
|
1067
|
+ if (currentVersion === undefined) {
|
|
|
1068
|
+ currentVersion = Services.prefs.getIntPref(MIGRATION_PREF, 0);
|
|
|
1069
|
+ }
|
|
|
1070
|
+
|
|
1060
|
1071
|
if (currentVersion < 1) {
|
|
1061
|
1072
|
Services.prefs.clearUserPref(
|
|
1062
|
1073
|
"layout.css.prefers-color-scheme.content-override"
|
| ... |
... |
@@ -1163,7 +1174,15 @@ export let ProfileDataUpgrader = { |
|
1163
|
1174
|
Services.prefs.setIntPref(MIGRATION_PREF, MIGRATION_VERSION);
|
|
1164
|
1175
|
},
|
|
1165
|
1176
|
|
|
1166
|
|
- async upgradeTB(isNewProfile) {
|
|
|
1177
|
+ /**
|
|
|
1178
|
+ * Run the profile data migration for Tor Browser if needed.
|
|
|
1179
|
+ *
|
|
|
1180
|
+ * @param {boolean} isNewProfile When true, just set the migration version
|
|
|
1181
|
+ * without actually changing anything.
|
|
|
1182
|
+ * @param {number} [currentVersion] The version to migrating from. To be used
|
|
|
1183
|
+ * only by tests.
|
|
|
1184
|
+ */
|
|
|
1185
|
+ async upgradeTB(isNewProfile, currentVersion) {
|
|
1167
|
1186
|
// Version 1: Tor Browser 12.0. We use it to remove langpacks, after the
|
|
1168
|
1187
|
// migration to packaged locales.
|
|
1169
|
1188
|
// Version 2: Tor Browser 13.0/13.0a1: tor-browser#41845. Also, removed some
|
| ... |
... |
@@ -1199,7 +1218,10 @@ export let ProfileDataUpgrader = { |
|
1199
|
1218
|
console.error("upgradeTB: isNewProfile is undefined.");
|
|
1200
|
1219
|
}
|
|
1201
|
1220
|
|
|
1202
|
|
- const currentVersion = Services.prefs.getIntPref(MIGRATION_PREF, 0);
|
|
|
1221
|
+ if (currentVersion === undefined) {
|
|
|
1222
|
+ currentVersion = Services.prefs.getIntPref(MIGRATION_PREF, 0);
|
|
|
1223
|
+ }
|
|
|
1224
|
+
|
|
1203
|
1225
|
const removeLangpacks = async () => {
|
|
1204
|
1226
|
for (const addon of await AddonManager.getAddonsByTypes(["locale"])) {
|
|
1205
|
1227
|
await addon.uninstall();
|