Skip to content
Snippets Groups Projects
Verified Commit 64a7ad48 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame :jack_o_lantern:
Browse files

fixup! Bug 42027: Base Browser migration procedures.

Bug 43124: Implement a migration procedure for Android.
parent 7e440906
Branches
Tags
1 merge request!1222Bug 43166: Rebased alpha onto 128.3.0esr
......@@ -259,6 +259,8 @@ export class GeckoViewStartup {
"GeckoView:InitialForeground",
]);
this.#migratePreferences();
Services.obs.addObserver(this, "browser-idle-startup-tasks-finished");
Services.obs.addObserver(this, "handlersvc-store-initialized");
......@@ -365,6 +367,50 @@ export class GeckoViewStartup {
break;
}
}
/**
* This is the equivalent of BrowserGlue._migrateUITBB.
*/
#migratePreferences() {
const MIGRATION_VERSION = 1;
const MIGRATION_PREF = "torbrowser.migration_android.version";
// We do not have a way to check for new profiles on Android.
// However, the first version is harmless for new installs, so run it
// anyway.
const currentVersion = Services.prefs.getIntPref(MIGRATION_PREF, 0);
if (currentVersion < 1) {
// First implementation of the migration on Android (tor-browser#43124,
// 14.0a5, September 2024).
const prefToClear = [
// Old torbutton preferences not used anymore.
// Some of them should have never been set on Android, as on Android we
// force PBM... But who knows about very old profiles.
"browser.cache.disk.enable",
"places.history.enabled",
"security.nocertdb",
"permissions.memory_only",
"extensions.torbutton.loglevel",
"extensions.torbutton.logmethod",
"extensions.torbutton.pref_fixup_version",
"extensions.torbutton.resize_new_windows",
"extensions.torbutton.startup",
"extensions.torlauncher.prompt_for_locale",
"extensions.torlauncher.loglevel",
"extensions.torlauncher.logmethod",
"extensions.torlauncher.torrc_fixup_version",
// tor-browser#42149: Do not change HTTPS-Only settings in the security
// level.
"dom.security.https_only_mode_send_http_background_request",
];
for (const pref of prefToClear) {
if (Services.prefs.prefHasUserValue(pref)) {
Services.prefs.clearUserPref(pref);
}
}
}
Services.prefs.setIntPref(MIGRATION_PREF, MIGRATION_VERSION);
}
}
GeckoViewStartup.prototype.classID = Components.ID(
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment