Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor Browser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Tor Browser
Commits
a8644cd7
Commit
a8644cd7
authored
Aug 18, 2023
by
Pier Angelo Vendrame
Browse files
Options
Downloads
Patches
Plain Diff
BB 42027: Base Browser migration procedures.
This commit implmenents the the Base Browser's version of _migrateUI.
parent
d4a62fa5
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!1505
BB/TB 43416: Rebased onto 135.0a1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
browser/components/BrowserGlue.sys.mjs
+48
-0
48 additions, 0 deletions
browser/components/BrowserGlue.sys.mjs
mobile/shared/components/geckoview/GeckoViewStartup.sys.mjs
+46
-0
46 additions, 0 deletions
mobile/shared/components/geckoview/GeckoViewStartup.sys.mjs
with
94 additions
and
0 deletions
browser/components/BrowserGlue.sys.mjs
+
48
−
0
View file @
a8644cd7
...
...
@@ -1593,6 +1593,9 @@ BrowserGlue.prototype = {
// handle any UI migration
this._migrateUI();
// Base Browser-specific version of _migrateUI.
this._migrateUIBB();
if (!Services.prefs.prefHasUserValue(PREF_PDFJS_ISDEFAULT_CACHE_STATE)) {
lazy.PdfJs.checkIsDefault(this._isNewProfile);
}
...
...
@@ -4719,6 +4722,51 @@ BrowserGlue.prototype = {
Services.prefs.setIntPref("browser.migration.version", UI_VERSION);
},
_migrateUIBB() {
// 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
// the UI is hidden. tor-browser#42777.
// Also, do not set
// dom.security.https_only_mode_send_http_background_request in
// the security level anymore (tor-browser#42149).
// Also, reset security.xfocsp.errorReporting.automatic since we
// hid its neterror checkbox. tor-browser#42653.
// Version 3: 14.0a7: Reset general.smoothScroll. tor-browser#42070.
const MIGRATION_VERSION = 3;
const MIGRATION_PREF = "basebrowser.migration.version";
// We do not care whether this is a new or old profile, since in version 1
// we just quickly clear a user preference, which should not do anything to
// new profiles.
// Shall we ever raise the version number and have a watershed, we can add
// a check easily (any version > 0 will be an old profile).
const currentVersion = Services.prefs.getIntPref(MIGRATION_PREF, 0);
if (currentVersion < 1) {
Services.prefs.clearUserPref(
"layout.css.prefers-color-scheme.content-override"
);
}
if (currentVersion < 2) {
for (const prefName of [
"privacy.globalprivacycontrol.enabled",
"privacy.donottrackheader.enabled",
// Telemetry preference for if the user changed the value.
"privacy.globalprivacycontrol.was_ever_enabled",
// The next two preferences have no corresponding UI, but are related.
"privacy.globalprivacycontrol.functionality.enabled",
"privacy.globalprivacycontrol.pbmode.enabled",
"dom.security.https_only_mode_send_http_background_request",
"security.xfocsp.errorReporting.automatic",
]) {
Services.prefs.clearUserPref(prefName);
}
}
if (currentVersion < 3) {
Services.prefs.clearUserPref("general.smoothScroll");
}
Services.prefs.setIntPref(MIGRATION_PREF, MIGRATION_VERSION);
},
async _showUpgradeDialog() {
const data = await lazy.OnboardingMessageProvider.getUpgradeMessage();
const { gBrowser } = lazy.BrowserWindowTracker.getTopWindow();
...
...
This diff is collapsed.
Click to expand it.
mobile/shared/components/geckoview/GeckoViewStartup.sys.mjs
+
46
−
0
View file @
a8644cd7
...
...
@@ -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
(
...
...
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