Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Mullvad Browser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
The Tor Project
Applications
Mullvad Browser
Commits
44371309
Verified
Commit
44371309
authored
7 months ago
by
henry
Committed by
Pier Angelo Vendrame
5 months ago
Browse files
Options
Downloads
Patches
Plain Diff
MB 419: Mullvad Browser migration procedures.
This commit implements the the Mullvad Browser's version of _migrateUI.
parent
182438d7
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!192
MB 433: Rebased onto 140.0a1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
browser/components/BrowserGlue.sys.mjs
+34
-0
34 additions, 0 deletions
browser/components/BrowserGlue.sys.mjs
with
34 additions
and
0 deletions
browser/components/BrowserGlue.sys.mjs
+
34
−
0
View file @
44371309
...
...
@@ -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
();
...
...
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment