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
352acb10
Commit
352acb10
authored
Apr 19, 2023
by
henry
Committed by
Richard Pospesel
Apr 20, 2023
Browse files
Options
Downloads
Patches
Plain Diff
Bug 41736 - Customize toolbar for tor-browser.
parent
491718d1
No related branches found
No related tags found
1 merge request
!627
Bug 41736 - Customize toolbar for tor-browser.
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
browser/components/customizableui/CustomizableUI.jsm
+32
-0
32 additions, 0 deletions
browser/components/customizableui/CustomizableUI.jsm
with
32 additions
and
0 deletions
browser/components/customizableui/CustomizableUI.jsm
+
32
−
0
View file @
352acb10
...
...
@@ -70,6 +70,11 @@ var kVersion = 17;
*/
var kVersionBaseBrowser = 1;
/**
* The current version for tor browser.
*/
var kVersionTorBrowser = 1;
/**
* Buttons removed from built-ins by version they were removed. kVersion must be
* bumped any time a new id is added to this. Use the button id as key, and
...
...
@@ -224,6 +229,7 @@ var CustomizableUIInternal = {
this._updateForNewProtonVersion();
this._markObsoleteBuiltinButtonsSeen();
this._updateForBaseBrowser();
this._updateForTorBrowser();
this.registerArea(
CustomizableUI.AREA_FIXED_OVERFLOW_PANEL,
...
...
@@ -249,6 +255,8 @@ var CustomizableUIInternal = {
// Base-browser additions tor-browser#41736. If you want to add to, remove
// from, or rearrange this list, then bump the kVersionBaseBrowser and
// update existing saved states in _updateForBaseBrowser.
// Or if the change is only meant for tor-browser, bump kVersionTorBrowser
// instead and update the existing saved states in _updateForTorBrowser.
"security-level-button",
"new-identity-button",
"downloads-button",
...
...
@@ -800,6 +808,25 @@ var CustomizableUIInternal = {
}
},
_updateForTorBrowser() {
if (!gSavedState) {
// Use the defaults.
return;
}
const currentVersion = gSavedState.currentVersionTorBrowser;
if (currentVersion < 1) {
// Remove torbutton-button, which no longer exists.
for (const placements of Object.values(gSavedState.placements)) {
let buttonIndex = placements.indexOf("torbutton-button");
if (buttonIndex != -1) {
placements.splice(buttonIndex, 1);
}
}
}
},
_placeNewDefaultWidgetsInArea(aArea) {
let futurePlacedWidgets = gFuturePlacements.get(aArea);
let savedPlacements =
...
...
@@ -2618,6 +2645,10 @@ var CustomizableUIInternal = {
gSavedState.currentVersionBaseBrowser = 0;
}
if (!("currentVersionTorBrowser" in gSavedState)) {
gSavedState.currentVersionTorBrowser = 0;
}
gSeenWidgets = new Set(gSavedState.seen || []);
gDirtyAreaCache = new Set(gSavedState.dirtyAreaCache || []);
gNewElementCount = gSavedState.newElementCount || 0;
...
...
@@ -2697,6 +2728,7 @@ var CustomizableUIInternal = {
dirtyAreaCache: gDirtyAreaCache,
currentVersion: kVersion,
currentVersionBaseBrowser: kVersionBaseBrowser,
currentVersionTorBrowser: kVersionTorBrowser,
newElementCount: gNewElementCount,
};
...
...
This diff is collapsed.
Click to expand it.
morgan
@morgan
mentioned in merge request
mullvad-browser!58 (closed)
·
Apr 20, 2023
mentioned in merge request
mullvad-browser!58 (closed)
mentioned in merge request mullvad-browser!58
Toggle commit list
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