Skip to content
Snippets Groups Projects
Verified Commit 44371309 authored by henry's avatar henry Committed by Pier Angelo Vendrame
Browse files

MB 419: Mullvad Browser migration procedures.

This commit implements the the Mullvad Browser's version of _migrateUI.
parent 182438d7
Branches
Tags
1 merge request!192MB 433: Rebased onto 140.0a1
......@@ -605,6 +605,9 @@ BrowserGlue.prototype = {
// Base Browser-specific version of _migrateUI.
this._migrateUIBB();
// Mullvad Browser-specific version of _migrateUI.
this._migrateUIMB();
if (!Services.prefs.prefHasUserValue(PREF_PDFJS_ISDEFAULT_CACHE_STATE)) {
lazy.PdfJs.checkIsDefault(this._isNewProfile);
}
......@@ -1877,6 +1880,37 @@ BrowserGlue.prototype = {
Services.prefs.setIntPref(MIGRATION_PREF, MIGRATION_VERSION);
},
// Use this method for any MB migration that can be run just before showing
// the UI.
// Anything that critically needs to be migrated earlier should not use this.
_migrateUIMB() {
// Version 1: Mullvad Browser 14.5a6: Clear home page update url preference
// (mullvad-browser#411).
const MB_MIGRATION_VERSION = 1;
const MIGRATION_PREF = "mullvadbrowser.migration.version";
// If we decide to force updating users to pass through any version
// following 14.5, we can remove this check, and check only whether
// MIGRATION_PREF has a user value, like Mozilla does.
if (this._isNewProfile) {
// Do not migrate fresh profiles
Services.prefs.setIntPref(MIGRATION_PREF, MB_MIGRATION_VERSION);
return;
} else if (this._isNewProfile === undefined) {
// If this happens, check if upstream updated their function and do not
// set this member anymore!
console.error("_migrateUIMB: this._isNewProfile is undefined.");
}
const currentVersion = Services.prefs.getIntPref(MIGRATION_PREF, 0);
if (currentVersion < 1) {
Services.prefs.clearUserPref("mullvadbrowser.post_update.url");
}
Services.prefs.setIntPref(MIGRATION_PREF, MB_MIGRATION_VERSION);
},
async _showUpgradeDialog() {
const data = await lazy.OnboardingMessageProvider.getUpgradeMessage();
const { gBrowser } = lazy.BrowserWindowTracker.getTopWindow();
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment