forked from ZenBrowserMirrors/zen-desktop
This commit is contained in:
parent
697db429f6
commit
1aea93a57b
1 changed files with 51 additions and 38 deletions
|
@ -1,8 +1,8 @@
|
|||
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
|
||||
index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b62093051cc9a 100644
|
||||
index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..545a6122bc6d6ee55dab7f020cfbe1f13966d8e2 100644
|
||||
--- a/browser/components/tabbrowser/content/tabbrowser.js
|
||||
+++ b/browser/components/tabbrowser/content/tabbrowser.js
|
||||
@@ -406,11 +406,39 @@
|
||||
@@ -406,11 +406,52 @@
|
||||
return this.tabContainer.visibleTabs;
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,19 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209
|
|||
+ break;
|
||||
+ }
|
||||
+ if (!tab.hidden) {
|
||||
+ i += !tab.hasAttribute("zen-glance-tab");
|
||||
+ }
|
||||
+ }
|
||||
+ return i;
|
||||
+ }
|
||||
+
|
||||
+ get _numVisiblePinTabsWithoutGlance() {
|
||||
+ let i = 0;
|
||||
+ for (let tab of this.tabs) {
|
||||
+ if (!tab.pinned) {
|
||||
+ break;
|
||||
+ }
|
||||
+ if (!tab.hidden && !tab.hasAttribute("zen-glance-tab")) {
|
||||
+ i++;
|
||||
+ }
|
||||
+ }
|
||||
|
@ -26,7 +39,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209
|
|||
+ break;
|
||||
+ }
|
||||
+ if (!tab.hidden) {
|
||||
+ i++;
|
||||
+ i += !tab.hasAttribute("zen-glance-tab");
|
||||
+ }
|
||||
+ }
|
||||
+ return i;
|
||||
|
@ -40,11 +53,11 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209
|
|||
+ if (!tab.pinned && !tab.hasAttribute("zen-glance-tab")) {
|
||||
break;
|
||||
}
|
||||
+ i++;
|
||||
+ i += !tab.hasAttribute("zen-glance-tab");
|
||||
}
|
||||
return i;
|
||||
}
|
||||
@@ -807,7 +835,7 @@
|
||||
@@ -807,7 +848,7 @@
|
||||
this.showTab(aTab);
|
||||
if (this.tabContainer.verticalMode) {
|
||||
this._handleTabMove(aTab, () =>
|
||||
|
@ -53,7 +66,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209
|
|||
);
|
||||
} else {
|
||||
this.moveTabTo(aTab, this.pinnedTabCount, { forceStandaloneTab: true });
|
||||
@@ -828,7 +856,7 @@
|
||||
@@ -828,7 +869,7 @@
|
||||
// the moving of a tab from the vertical pinned tabs container
|
||||
// and back into arrowscrollbox.
|
||||
aTab.removeAttribute("pinned");
|
||||
|
@ -62,7 +75,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209
|
|||
});
|
||||
} else {
|
||||
this.moveTabTo(aTab, this.pinnedTabCount - 1, {
|
||||
@@ -1055,6 +1083,8 @@
|
||||
@@ -1055,6 +1096,8 @@
|
||||
|
||||
let LOCAL_PROTOCOLS = ["chrome:", "about:", "resource:", "data:"];
|
||||
|
||||
|
@ -71,7 +84,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209
|
|||
if (
|
||||
aIconURL &&
|
||||
!aLoadingPrincipal &&
|
||||
@@ -1065,6 +1095,9 @@
|
||||
@@ -1065,6 +1108,9 @@
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
@ -81,7 +94,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209
|
|||
|
||||
let browser = this.getBrowserForTab(aTab);
|
||||
browser.mIconURL = aIconURL;
|
||||
@@ -1310,6 +1343,7 @@
|
||||
@@ -1310,6 +1356,7 @@
|
||||
if (!this._previewMode) {
|
||||
newTab.recordTimeFromUnloadToReload();
|
||||
newTab.updateLastAccessed();
|
||||
|
@ -89,7 +102,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209
|
|||
oldTab.updateLastAccessed();
|
||||
// if this is the foreground window, update the last-seen timestamps.
|
||||
if (this.ownerGlobal == BrowserWindowTracker.getTopWindow()) {
|
||||
@@ -1462,6 +1496,9 @@
|
||||
@@ -1462,6 +1509,9 @@
|
||||
}
|
||||
|
||||
let activeEl = document.activeElement;
|
||||
|
@ -99,7 +112,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209
|
|||
// If focus is on the old tab, move it to the new tab.
|
||||
if (activeEl == oldTab) {
|
||||
newTab.focus();
|
||||
@@ -2387,7 +2424,7 @@
|
||||
@@ -2387,7 +2437,7 @@
|
||||
|
||||
let panel = this.getPanel(browser);
|
||||
let uniqueId = this._generateUniquePanelID();
|
||||
|
@ -108,7 +121,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209
|
|||
aTab.linkedPanel = uniqueId;
|
||||
|
||||
// Inject the <browser> into the DOM if necessary.
|
||||
@@ -2446,8 +2483,8 @@
|
||||
@@ -2446,8 +2496,8 @@
|
||||
// If we transitioned from one browser to two browsers, we need to set
|
||||
// hasSiblings=false on both the existing browser and the new browser.
|
||||
if (this.tabs.length == 2) {
|
||||
|
@ -119,7 +132,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209
|
|||
} else {
|
||||
aTab.linkedBrowser.browsingContext.hasSiblings = this.tabs.length > 1;
|
||||
}
|
||||
@@ -2679,6 +2716,12 @@
|
||||
@@ -2679,6 +2729,12 @@
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -132,7 +145,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209
|
|||
if (!UserInteraction.running("browser.tabs.opening", window)) {
|
||||
UserInteraction.start("browser.tabs.opening", "initting", window);
|
||||
}
|
||||
@@ -2742,6 +2785,12 @@
|
||||
@@ -2742,6 +2798,12 @@
|
||||
noInitialLabel,
|
||||
skipBackgroundNotify,
|
||||
});
|
||||
|
@ -145,7 +158,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209
|
|||
if (insertTab) {
|
||||
// insert the tab into the tab container in the correct position
|
||||
this._insertTabAtIndex(t, {
|
||||
@@ -2885,6 +2934,9 @@
|
||||
@@ -2885,6 +2947,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -155,7 +168,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209
|
|||
// Additionally send pinned tab events
|
||||
if (pinned) {
|
||||
this._notifyPinnedStatus(t);
|
||||
@@ -3403,6 +3455,21 @@
|
||||
@@ -3403,6 +3468,21 @@
|
||||
) {
|
||||
tabWasReused = true;
|
||||
tab = this.selectedTab;
|
||||
|
@ -177,7 +190,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209
|
|||
if (!tabData.pinned) {
|
||||
this.unpinTab(tab);
|
||||
} else {
|
||||
@@ -3416,6 +3483,7 @@
|
||||
@@ -3416,6 +3496,7 @@
|
||||
restoreTabsLazily && !select && !tabData.pinned;
|
||||
|
||||
let url = "about:blank";
|
||||
|
@ -185,7 +198,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209
|
|||
if (tabData.entries?.length) {
|
||||
let activeIndex = (tabData.index || tabData.entries.length) - 1;
|
||||
// Ensure the index is in bounds.
|
||||
@@ -3451,7 +3519,21 @@
|
||||
@@ -3451,7 +3532,21 @@
|
||||
skipLoad: true,
|
||||
preferredRemoteType,
|
||||
});
|
||||
|
@ -208,7 +221,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209
|
|||
if (select) {
|
||||
tabToSelect = tab;
|
||||
}
|
||||
@@ -3464,8 +3546,8 @@
|
||||
@@ -3464,8 +3559,8 @@
|
||||
// inserted in the DOM. If the tab is not yet in the DOM,
|
||||
// just insert it in the right place from the start.
|
||||
if (!tab.parentNode) {
|
||||
|
@ -219,7 +232,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209
|
|||
tab.toggleAttribute("pinned", true);
|
||||
this.tabContainer._invalidateCachedTabs();
|
||||
// Then ensure all the tab open/pinning information is sent.
|
||||
@@ -3729,7 +3811,7 @@
|
||||
@@ -3729,7 +3824,7 @@
|
||||
// Ensure we have an index if one was not provided.
|
||||
if (typeof index != "number") {
|
||||
// Move the new tab after another tab if needed, to the end otherwise.
|
||||
|
@ -228,7 +241,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209
|
|||
if (
|
||||
!bulkOrderedOpen &&
|
||||
((openerTab &&
|
||||
@@ -3780,7 +3862,7 @@
|
||||
@@ -3780,7 +3875,7 @@
|
||||
}
|
||||
|
||||
/** @type {MozTabbrowserTab|undefined} */
|
||||
|
@ -237,7 +250,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209
|
|||
this.tabContainer._invalidateCachedTabs();
|
||||
|
||||
if (tabGroup) {
|
||||
@@ -4095,6 +4177,9 @@
|
||||
@@ -4095,6 +4190,9 @@
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -247,7 +260,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209
|
|||
this.removeTabs(selectedTabs);
|
||||
}
|
||||
|
||||
@@ -4427,6 +4512,7 @@
|
||||
@@ -4427,6 +4525,7 @@
|
||||
skipSessionStore,
|
||||
} = {}
|
||||
) {
|
||||
|
@ -255,7 +268,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209
|
|||
if (UserInteraction.running("browser.tabs.opening", window)) {
|
||||
UserInteraction.finish("browser.tabs.opening", window);
|
||||
}
|
||||
@@ -4443,6 +4529,12 @@
|
||||
@@ -4443,6 +4542,12 @@
|
||||
TelemetryStopwatch.start("FX_TAB_CLOSE_TIME_NO_ANIM_MS", aTab);
|
||||
}
|
||||
|
||||
|
@ -268,7 +281,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209
|
|||
// Handle requests for synchronously removing an already
|
||||
// asynchronously closing tab.
|
||||
if (!animate && aTab.closing) {
|
||||
@@ -4457,7 +4549,9 @@
|
||||
@@ -4457,7 +4562,9 @@
|
||||
// frame created for it (for example, by updating the visually selected
|
||||
// state).
|
||||
let tabWidth = window.windowUtils.getBoundsWithoutFlushing(aTab).width;
|
||||
|
@ -279,7 +292,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209
|
|||
if (
|
||||
!this._beginRemoveTab(aTab, {
|
||||
closeWindowFastpath: true,
|
||||
@@ -4471,7 +4565,6 @@
|
||||
@@ -4471,7 +4578,6 @@
|
||||
TelemetryStopwatch.cancel("FX_TAB_CLOSE_TIME_NO_ANIM_MS", aTab);
|
||||
return;
|
||||
}
|
||||
|
@ -287,7 +300,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209
|
|||
let lockTabSizing =
|
||||
!this.tabContainer.verticalMode &&
|
||||
!aTab.pinned &&
|
||||
@@ -4610,14 +4703,14 @@
|
||||
@@ -4610,14 +4716,14 @@
|
||||
!!this.tabsInCollapsedTabGroups.length;
|
||||
if (
|
||||
aTab.visible &&
|
||||
|
@ -304,7 +317,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209
|
|||
|
||||
if (closeWindow) {
|
||||
// We've already called beforeunload on all the relevant tabs if we get here,
|
||||
@@ -4812,6 +4905,8 @@
|
||||
@@ -4812,6 +4918,8 @@
|
||||
this.tabs[i]._tPos = i;
|
||||
}
|
||||
|
||||
|
@ -313,7 +326,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209
|
|||
if (!this._windowIsClosing) {
|
||||
if (wasPinned) {
|
||||
this.tabContainer._positionPinnedTabs();
|
||||
@@ -5465,10 +5560,10 @@
|
||||
@@ -5465,10 +5573,10 @@
|
||||
SessionStore.deleteCustomTabValue(aTab, "hiddenBy");
|
||||
}
|
||||
|
||||
|
@ -326,19 +339,19 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209
|
|||
aTab.selected ||
|
||||
aTab.closing ||
|
||||
// Tabs that are sharing the screen, microphone or camera cannot be hidden.
|
||||
@@ -5706,9 +5801,9 @@
|
||||
@@ -5706,9 +5814,9 @@
|
||||
|
||||
// Don't allow mixing pinned and unpinned tabs.
|
||||
if (aTab.pinned) {
|
||||
- aIndex = Math.min(aIndex, this.pinnedTabCount - 1);
|
||||
+ aIndex = Math.min(aIndex, this._numVisiblePinTabs - 1);
|
||||
+ aIndex = Math.min(aIndex, (aTab.hasAttribute('zen-essential') ? this._numZenEssentials : this._numVisiblePinTabsWithoutGlance) - 1);
|
||||
} else {
|
||||
- aIndex = Math.max(aIndex, this.pinnedTabCount);
|
||||
+ aIndex = Math.max(aIndex, this._numVisiblePinTabs);
|
||||
+ aIndex = Math.max(aIndex, this._numVisiblePinTabsWithoutGlance);
|
||||
}
|
||||
if (aTab._tPos == aIndex) {
|
||||
return;
|
||||
@@ -5727,6 +5822,9 @@
|
||||
@@ -5727,6 +5835,9 @@
|
||||
this.tabContainer.insertBefore(aTab, neighbor);
|
||||
}
|
||||
});
|
||||
|
@ -348,7 +361,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209
|
|||
}
|
||||
|
||||
moveTabToGroup(aTab, aGroup) {
|
||||
@@ -5802,7 +5900,7 @@
|
||||
@@ -5802,7 +5913,7 @@
|
||||
createLazyBrowser,
|
||||
};
|
||||
|
||||
|
@ -357,7 +370,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209
|
|||
if (aIndex < numPinned || (aTab.pinned && aIndex == numPinned)) {
|
||||
params.pinned = true;
|
||||
}
|
||||
@@ -7443,6 +7541,7 @@
|
||||
@@ -7443,6 +7554,7 @@
|
||||
aWebProgress.isTopLevel
|
||||
) {
|
||||
this.mTab.setAttribute("busy", "true");
|
||||
|
@ -365,7 +378,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209
|
|||
gBrowser._tabAttrModified(this.mTab, ["busy"]);
|
||||
this.mTab._notselectedsinceload = !this.mTab.selected;
|
||||
gBrowser.syncThrobberAnimations(this.mTab);
|
||||
@@ -8411,7 +8510,7 @@ var TabContextMenu = {
|
||||
@@ -8411,7 +8523,7 @@ var TabContextMenu = {
|
||||
);
|
||||
contextUnpinSelectedTabs.hidden =
|
||||
!this.contextTab.pinned || !multiselectionContext;
|
||||
|
@ -374,7 +387,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209
|
|||
// Move Tab items
|
||||
let contextMoveTabOptions = document.getElementById(
|
||||
"context_moveTabOptions"
|
||||
@@ -8444,7 +8543,7 @@ var TabContextMenu = {
|
||||
@@ -8444,7 +8556,7 @@ var TabContextMenu = {
|
||||
let contextMoveTabToStart = document.getElementById("context_moveToStart");
|
||||
let isFirstTab =
|
||||
tabsToMove[0] == visibleTabs[0] ||
|
||||
|
@ -383,7 +396,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209
|
|||
contextMoveTabToStart.disabled = isFirstTab && allSelectedTabsAdjacent;
|
||||
|
||||
document.getElementById("context_openTabInWindow").disabled =
|
||||
@@ -8677,6 +8776,7 @@ var TabContextMenu = {
|
||||
@@ -8677,6 +8789,7 @@ var TabContextMenu = {
|
||||
if (this.contextTab.multiselected) {
|
||||
gBrowser.removeMultiSelectedTabs();
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue