chore: Small changes before release, b=(no-bug), c=tabs

This commit is contained in:
Mr. M 2025-05-07 17:13:09 +02:00
parent 414bafde9c
commit ad32b31904
No known key found for this signature in database
GPG key ID: 6292C4C8F8652B18
4 changed files with 69 additions and 79 deletions

View file

@ -24,3 +24,5 @@ pref("browser.formfill.enable", false);
pref("security.insecure_connection_text.enabled", true); pref("security.insecure_connection_text.enabled", true);
pref("security.insecure_connection_text.pbmode.enabled", true); pref("security.insecure_connection_text.pbmode.enabled", true);
pref("network.IDN_show_punycode", true); pref("network.IDN_show_punycode", true);
pref("browser.urlbar.suggest.topsites", true, locked);

View file

@ -1,8 +1,8 @@
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354d2d307a9 100644 index 6dece2b9d0462d90a28e75350ce983d87816ef73..1f51159eaa73af582b7a6f49c2b4665ec664e1bf 100644
--- a/browser/components/tabbrowser/content/tabbrowser.js --- a/browser/components/tabbrowser/content/tabbrowser.js
+++ b/browser/components/tabbrowser/content/tabbrowser.js +++ b/browser/components/tabbrowser/content/tabbrowser.js
@@ -415,11 +415,58 @@ @@ -415,11 +415,45 @@
return this.tabContainer.visibleTabs; return this.tabContainer.visibleTabs;
} }
@ -37,19 +37,6 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
+ } + }
+ return i; + return i;
+ } + }
+
+ get _numZenVisibleEssentials() {
+ let i = 0;
+ for (let tab of this.tabs) {
+ if (!tab.hasAttribute("zen-essential") && !tab.hasAttribute("zen-glance-tab")) {
+ break;
+ }
+ if (!tab.hidden) {
+ i += !tab.hasAttribute("zen-glance-tab");
+ }
+ }
+ return i;
+ }
+ +
get pinnedTabCount() { get pinnedTabCount() {
- for (var i = 0; i < this.tabs.length; i++) { - for (var i = 0; i < this.tabs.length; i++) {
@ -63,7 +50,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
} }
return i; return i;
} }
@@ -571,6 +618,7 @@ @@ -571,6 +605,7 @@
this.tabpanels.appendChild(panel); this.tabpanels.appendChild(panel);
let tab = this.tabs[0]; let tab = this.tabs[0];
@ -71,7 +58,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
tab.linkedPanel = uniqueId; tab.linkedPanel = uniqueId;
this._selectedTab = tab; this._selectedTab = tab;
this._selectedBrowser = browser; this._selectedBrowser = browser;
@@ -836,11 +884,13 @@ @@ -836,11 +871,13 @@
} }
this.showTab(aTab); this.showTab(aTab);
@ -88,7 +75,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
this.moveTabTo(aTab, { this.moveTabTo(aTab, {
tabIndex: this.pinnedTabCount, tabIndex: this.pinnedTabCount,
forceUngrouped: true, forceUngrouped: true,
@@ -857,12 +907,15 @@ @@ -857,12 +894,15 @@
} }
if (this.tabContainer.verticalMode) { if (this.tabContainer.verticalMode) {
@ -105,7 +92,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
}); });
} else { } else {
this.moveTabTo(aTab, { this.moveTabTo(aTab, {
@@ -1046,6 +1099,8 @@ @@ -1046,6 +1086,8 @@
let LOCAL_PROTOCOLS = ["chrome:", "about:", "resource:", "data:"]; let LOCAL_PROTOCOLS = ["chrome:", "about:", "resource:", "data:"];
@ -114,7 +101,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
if ( if (
aIconURL && aIconURL &&
!aLoadingPrincipal && !aLoadingPrincipal &&
@@ -1056,6 +1111,9 @@ @@ -1056,6 +1098,9 @@
); );
return; return;
} }
@ -124,7 +111,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
let browser = this.getBrowserForTab(aTab); let browser = this.getBrowserForTab(aTab);
browser.mIconURL = aIconURL; browser.mIconURL = aIconURL;
@@ -1305,6 +1363,7 @@ @@ -1305,6 +1350,7 @@
if (!this._previewMode) { if (!this._previewMode) {
newTab.recordTimeFromUnloadToReload(); newTab.recordTimeFromUnloadToReload();
newTab.updateLastAccessed(); newTab.updateLastAccessed();
@ -132,7 +119,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
oldTab.updateLastAccessed(); oldTab.updateLastAccessed();
// if this is the foreground window, update the last-seen timestamps. // if this is the foreground window, update the last-seen timestamps.
if (this.ownerGlobal == BrowserWindowTracker.getTopWindow()) { if (this.ownerGlobal == BrowserWindowTracker.getTopWindow()) {
@@ -1457,6 +1516,9 @@ @@ -1457,6 +1503,9 @@
} }
let activeEl = document.activeElement; let activeEl = document.activeElement;
@ -142,7 +129,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
// If focus is on the old tab, move it to the new tab. // If focus is on the old tab, move it to the new tab.
if (activeEl == oldTab) { if (activeEl == oldTab) {
newTab.focus(); newTab.focus();
@@ -1780,7 +1842,8 @@ @@ -1780,7 +1829,8 @@
} }
_setTabLabel(aTab, aLabel, { beforeTabOpen, isContentTitle, isURL } = {}) { _setTabLabel(aTab, aLabel, { beforeTabOpen, isContentTitle, isURL } = {}) {
@ -152,7 +139,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
return false; return false;
} }
@@ -1888,7 +1951,7 @@ @@ -1888,7 +1938,7 @@
newIndex = this.selectedTab._tPos + 1; newIndex = this.selectedTab._tPos + 1;
} }
@ -161,7 +148,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
if (this.isTabGroupLabel(targetTab)) { if (this.isTabGroupLabel(targetTab)) {
throw new Error( throw new Error(
"Replacing a tab group label with a tab is not supported" "Replacing a tab group label with a tab is not supported"
@@ -2152,6 +2215,7 @@ @@ -2152,6 +2202,7 @@
uriIsAboutBlank, uriIsAboutBlank,
userContextId, userContextId,
skipLoad, skipLoad,
@ -169,7 +156,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
} = {}) { } = {}) {
let b = document.createXULElement("browser"); let b = document.createXULElement("browser");
// Use the JSM global to create the permanentKey, so that if the // Use the JSM global to create the permanentKey, so that if the
@@ -2225,8 +2289,7 @@ @@ -2225,8 +2276,7 @@
// we use a different attribute name for this? // we use a different attribute name for this?
b.setAttribute("name", name); b.setAttribute("name", name);
} }
@ -179,7 +166,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
b.setAttribute("transparent", "true"); b.setAttribute("transparent", "true");
} }
@@ -2391,7 +2454,7 @@ @@ -2391,7 +2441,7 @@
let panel = this.getPanel(browser); let panel = this.getPanel(browser);
let uniqueId = this._generateUniquePanelID(); let uniqueId = this._generateUniquePanelID();
@ -188,7 +175,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
aTab.linkedPanel = uniqueId; aTab.linkedPanel = uniqueId;
// Inject the <browser> into the DOM if necessary. // Inject the <browser> into the DOM if necessary.
@@ -2450,8 +2513,8 @@ @@ -2450,8 +2500,8 @@
// If we transitioned from one browser to two browsers, we need to set // If we transitioned from one browser to two browsers, we need to set
// hasSiblings=false on both the existing browser and the new browser. // hasSiblings=false on both the existing browser and the new browser.
if (this.tabs.length == 2) { if (this.tabs.length == 2) {
@ -199,7 +186,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
} else { } else {
aTab.linkedBrowser.browsingContext.hasSiblings = this.tabs.length > 1; aTab.linkedBrowser.browsingContext.hasSiblings = this.tabs.length > 1;
} }
@@ -2679,6 +2742,7 @@ @@ -2679,6 +2729,7 @@
schemelessInput, schemelessInput,
hasValidUserGestureActivation = false, hasValidUserGestureActivation = false,
textDirectiveUserActivation = false, textDirectiveUserActivation = false,
@ -207,7 +194,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
} = {} } = {}
) { ) {
// all callers of addTab that pass a params object need to pass // all callers of addTab that pass a params object need to pass
@@ -2689,6 +2753,12 @@ @@ -2689,6 +2740,12 @@
); );
} }
@ -220,7 +207,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
if (!UserInteraction.running("browser.tabs.opening", window)) { if (!UserInteraction.running("browser.tabs.opening", window)) {
UserInteraction.start("browser.tabs.opening", "initting", window); UserInteraction.start("browser.tabs.opening", "initting", window);
} }
@@ -2752,6 +2822,16 @@ @@ -2752,6 +2809,16 @@
noInitialLabel, noInitialLabel,
skipBackgroundNotify, skipBackgroundNotify,
}); });
@ -237,7 +224,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
if (insertTab) { if (insertTab) {
if (typeof index == "number") { if (typeof index == "number") {
elementIndex = this.#tabIndexToElementIndex(index); elementIndex = this.#tabIndexToElementIndex(index);
@@ -2779,6 +2859,7 @@ @@ -2779,6 +2846,7 @@
openWindowInfo, openWindowInfo,
skipLoad, skipLoad,
triggeringRemoteType, triggeringRemoteType,
@ -245,7 +232,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
})); }));
if (focusUrlBar) { if (focusUrlBar) {
@@ -2898,6 +2979,9 @@ @@ -2898,6 +2966,9 @@
} }
} }
@ -255,7 +242,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
// Additionally send pinned tab events // Additionally send pinned tab events
if (pinned) { if (pinned) {
this._notifyPinnedStatus(t); this._notifyPinnedStatus(t);
@@ -2945,12 +3029,15 @@ @@ -2945,12 +3016,15 @@
* @param {string} [label=] * @param {string} [label=]
* @returns {MozTabbrowserTabGroup} * @returns {MozTabbrowserTabGroup}
*/ */
@ -272,7 +259,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
return group; return group;
} }
@@ -2993,6 +3080,7 @@ @@ -2993,6 +3067,7 @@
insertBefore = null, insertBefore = null,
isUserTriggered = false, isUserTriggered = false,
telemetryUserCreateSource = "unknown", telemetryUserCreateSource = "unknown",
@ -280,7 +267,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
} = {} } = {}
) { ) {
if (!tabs?.length) { if (!tabs?.length) {
@@ -3011,7 +3099,12 @@ @@ -3011,7 +3086,12 @@
id = `${Date.now()}-${Math.round(Math.random() * 100)}`; id = `${Date.now()}-${Math.round(Math.random() * 100)}`;
} }
let group = this._createTabGroup(id, color, false, label); let group = this._createTabGroup(id, color, false, label);
@ -294,7 +281,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
group, group,
insertBefore?.group ?? insertBefore insertBefore?.group ?? insertBefore
); );
@@ -3342,6 +3435,7 @@ @@ -3342,6 +3422,7 @@
openWindowInfo, openWindowInfo,
skipLoad, skipLoad,
triggeringRemoteType, triggeringRemoteType,
@ -302,7 +289,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
} }
) { ) {
// If we don't have a preferred remote type (or it is `NOT_REMOTE`), and // If we don't have a preferred remote type (or it is `NOT_REMOTE`), and
@@ -3411,6 +3505,7 @@ @@ -3411,6 +3492,7 @@
openWindowInfo, openWindowInfo,
name, name,
skipLoad, skipLoad,
@ -310,7 +297,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
}); });
} }
@@ -3599,7 +3694,7 @@ @@ -3599,7 +3681,7 @@
// Add a new tab if needed. // Add a new tab if needed.
if (!tab) { if (!tab) {
let createLazyBrowser = let createLazyBrowser =
@ -319,7 +306,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
let url = "about:blank"; let url = "about:blank";
if (tabData.entries?.length) { if (tabData.entries?.length) {
@@ -3638,6 +3733,27 @@ @@ -3638,6 +3720,27 @@
preferredRemoteType, preferredRemoteType,
}); });
@ -347,7 +334,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
if (select) { if (select) {
tabToSelect = tab; tabToSelect = tab;
} }
@@ -3661,7 +3777,8 @@ @@ -3661,7 +3764,8 @@
// needs calling: // needs calling:
shouldUpdateForPinnedTabs = true; shouldUpdateForPinnedTabs = true;
} }
@ -357,7 +344,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
let { groupId } = tabData; let { groupId } = tabData;
const tabGroup = tabGroupWorkingData.get(groupId); const tabGroup = tabGroupWorkingData.get(groupId);
// if a tab refers to a tab group we don't know, skip any group // if a tab refers to a tab group we don't know, skip any group
@@ -3675,7 +3792,10 @@ @@ -3675,7 +3779,10 @@
tabGroup.stateData.id, tabGroup.stateData.id,
tabGroup.stateData.color, tabGroup.stateData.color,
tabGroup.stateData.collapsed, tabGroup.stateData.collapsed,
@ -369,7 +356,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
); );
tabsFragment.appendChild(tabGroup.node); tabsFragment.appendChild(tabGroup.node);
} }
@@ -3723,8 +3843,21 @@ @@ -3723,8 +3830,21 @@
// to remove the old selected tab. // to remove the old selected tab.
if (tabToSelect) { if (tabToSelect) {
let leftoverTab = this.selectedTab; let leftoverTab = this.selectedTab;
@ -391,7 +378,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
} }
if (tabs.length > 1 || !tabs[0].selected) { if (tabs.length > 1 || !tabs[0].selected) {
@@ -3912,7 +4045,7 @@ @@ -3912,7 +4032,7 @@
// Ensure we have an index if one was not provided. // Ensure we have an index if one was not provided.
if (typeof index != "number") { if (typeof index != "number") {
// Move the new tab after another tab if needed, to the end otherwise. // Move the new tab after another tab if needed, to the end otherwise.
@ -400,7 +387,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
if ( if (
!bulkOrderedOpen && !bulkOrderedOpen &&
((openerTab && ((openerTab &&
@@ -3958,18 +4091,18 @@ @@ -3958,18 +4078,18 @@
// Ensure index is within bounds. // Ensure index is within bounds.
if (tab.pinned) { if (tab.pinned) {
@ -423,7 +410,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
if (this.isTab(itemAfter) && itemAfter.group == tabGroup) { if (this.isTab(itemAfter) && itemAfter.group == tabGroup) {
// Place at the front of, or between tabs in, the same tab group // Place at the front of, or between tabs in, the same tab group
this.tabContainer.insertBefore(tab, itemAfter); this.tabContainer.insertBefore(tab, itemAfter);
@@ -4290,6 +4423,9 @@ @@ -4290,6 +4410,9 @@
return; return;
} }
@ -433,7 +420,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
this.removeTabs(selectedTabs, { telemetrySource }); this.removeTabs(selectedTabs, { telemetrySource });
} }
@@ -4542,6 +4678,7 @@ @@ -4542,6 +4665,7 @@
telemetrySource, telemetrySource,
} = {} } = {}
) { ) {
@ -441,7 +428,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
// When 'closeWindowWithLastTab' pref is enabled, closing all tabs // When 'closeWindowWithLastTab' pref is enabled, closing all tabs
// can be considered equivalent to closing the window. // can be considered equivalent to closing the window.
if ( if (
@@ -4626,6 +4763,7 @@ @@ -4626,6 +4750,7 @@
if (lastToClose) { if (lastToClose) {
this.removeTab(lastToClose, aParams); this.removeTab(lastToClose, aParams);
} }
@ -449,7 +436,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
} catch (e) { } catch (e) {
console.error(e); console.error(e);
} }
@@ -4650,6 +4788,7 @@ @@ -4650,6 +4775,7 @@
telemetrySource, telemetrySource,
} = {} } = {}
) { ) {
@ -457,7 +444,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
if (UserInteraction.running("browser.tabs.opening", window)) { if (UserInteraction.running("browser.tabs.opening", window)) {
UserInteraction.finish("browser.tabs.opening", window); UserInteraction.finish("browser.tabs.opening", window);
} }
@@ -4663,6 +4802,12 @@ @@ -4663,6 +4789,12 @@
aTab._closeTimeNoAnimTimerId = Glean.browserTabclose.timeNoAnim.start(); aTab._closeTimeNoAnimTimerId = Glean.browserTabclose.timeNoAnim.start();
} }
@ -470,7 +457,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
// Handle requests for synchronously removing an already // Handle requests for synchronously removing an already
// asynchronously closing tab. // asynchronously closing tab.
if (!animate && aTab.closing) { if (!animate && aTab.closing) {
@@ -4677,7 +4822,9 @@ @@ -4677,7 +4809,9 @@
// frame created for it (for example, by updating the visually selected // frame created for it (for example, by updating the visually selected
// state). // state).
let tabWidth = window.windowUtils.getBoundsWithoutFlushing(aTab).width; let tabWidth = window.windowUtils.getBoundsWithoutFlushing(aTab).width;
@ -481,7 +468,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
if ( if (
!this._beginRemoveTab(aTab, { !this._beginRemoveTab(aTab, {
closeWindowFastpath: true, closeWindowFastpath: true,
@@ -4840,7 +4987,7 @@ @@ -4840,7 +4974,7 @@
closeWindowWithLastTab != null closeWindowWithLastTab != null
? closeWindowWithLastTab ? closeWindowWithLastTab
: !window.toolbar.visible || : !window.toolbar.visible ||
@ -490,7 +477,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
if (closeWindow) { if (closeWindow) {
// We've already called beforeunload on all the relevant tabs if we get here, // We've already called beforeunload on all the relevant tabs if we get here,
@@ -4864,6 +5011,7 @@ @@ -4864,6 +4998,7 @@
newTab = true; newTab = true;
} }
@ -498,7 +485,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
aTab._endRemoveArgs = [closeWindow, newTab]; aTab._endRemoveArgs = [closeWindow, newTab];
// swapBrowsersAndCloseOther will take care of closing the window without animation. // swapBrowsersAndCloseOther will take care of closing the window without animation.
@@ -4903,9 +5051,7 @@ @@ -4903,9 +5038,7 @@
aTab._mouseleave(); aTab._mouseleave();
if (newTab) { if (newTab) {
@ -509,7 +496,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
} else { } else {
TabBarVisibility.update(); TabBarVisibility.update();
} }
@@ -5034,6 +5180,8 @@ @@ -5034,6 +5167,8 @@
this.tabs[i]._tPos = i; this.tabs[i]._tPos = i;
} }
@ -518,7 +505,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
if (!this._windowIsClosing) { if (!this._windowIsClosing) {
if (wasPinned) { if (wasPinned) {
this.tabContainer._positionPinnedTabs(); this.tabContainer._positionPinnedTabs();
@@ -5159,8 +5307,8 @@ @@ -5159,8 +5294,8 @@
return closedCount; return closedCount;
} }
@ -529,7 +516,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
if (unloadBlocked) { if (unloadBlocked) {
return; return;
} }
@@ -5248,6 +5396,7 @@ @@ -5248,6 +5383,7 @@
} }
let excludeTabs = new Set(aExcludeTabs); let excludeTabs = new Set(aExcludeTabs);
@ -537,7 +524,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
// If this tab has a successor, it should be selectable, since // If this tab has a successor, it should be selectable, since
// hiding or closing a tab removes that tab as a successor. // hiding or closing a tab removes that tab as a successor.
@@ -5260,13 +5409,13 @@ @@ -5260,13 +5396,13 @@
!excludeTabs.has(aTab.owner) && !excludeTabs.has(aTab.owner) &&
Services.prefs.getBoolPref("browser.tabs.selectOwnerOnClose") Services.prefs.getBoolPref("browser.tabs.selectOwnerOnClose")
) { ) {
@ -553,7 +540,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
); );
let tab = this.tabContainer.findNextTab(aTab, { let tab = this.tabContainer.findNextTab(aTab, {
@@ -5282,7 +5431,7 @@ @@ -5282,7 +5418,7 @@
} }
if (tab) { if (tab) {
@ -562,7 +549,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
} }
// If no qualifying visible tab was found, see if there is a tab in // If no qualifying visible tab was found, see if there is a tab in
@@ -5303,7 +5452,7 @@ @@ -5303,7 +5439,7 @@
}); });
} }
@ -571,7 +558,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
} }
_blurTab(aTab) { _blurTab(aTab) {
@@ -5704,10 +5853,10 @@ @@ -5704,10 +5840,10 @@
SessionStore.deleteCustomTabValue(aTab, "hiddenBy"); SessionStore.deleteCustomTabValue(aTab, "hiddenBy");
} }
@ -584,7 +571,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
aTab.selected || aTab.selected ||
aTab.closing || aTab.closing ||
// Tabs that are sharing the screen, microphone or camera cannot be hidden. // Tabs that are sharing the screen, microphone or camera cannot be hidden.
@@ -6001,7 +6150,7 @@ @@ -6001,7 +6137,7 @@
// Don't allow mixing pinned and unpinned tabs. // Don't allow mixing pinned and unpinned tabs.
if (this.isTab(element) && element.pinned) { if (this.isTab(element) && element.pinned) {
@ -593,7 +580,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
} else { } else {
tabIndex = Math.max(tabIndex, this.pinnedTabCount); tabIndex = Math.max(tabIndex, this.pinnedTabCount);
} }
@@ -6028,9 +6177,16 @@ @@ -6028,9 +6164,16 @@
element, element,
() => { () => {
let neighbor = this.tabs[tabIndex]; let neighbor = this.tabs[tabIndex];
@ -611,7 +598,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
if (neighbor && this.isTab(element) && tabIndex > element._tPos) { if (neighbor && this.isTab(element) && tabIndex > element._tPos) {
neighbor.after(element); neighbor.after(element);
} else { } else {
@@ -6099,7 +6255,9 @@ @@ -6099,7 +6242,9 @@
targetElement = targetElement.group; targetElement = targetElement.group;
} }
} }
@ -622,7 +609,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
// Don't allow mixing pinned and unpinned tabs. // Don't allow mixing pinned and unpinned tabs.
if (element.pinned && !targetElement?.pinned) { if (element.pinned && !targetElement?.pinned) {
targetElement = this.tabs[this.pinnedTabCount - 1]; targetElement = this.tabs[this.pinnedTabCount - 1];
@@ -6109,7 +6267,13 @@ @@ -6109,7 +6254,13 @@
moveBefore = true; moveBefore = true;
} }
@ -636,7 +623,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
if (element.pinned && this.tabContainer.verticalMode) { if (element.pinned && this.tabContainer.verticalMode) {
return this.tabContainer.verticalPinnedTabsContainer; return this.tabContainer.verticalPinnedTabsContainer;
} }
@@ -6169,7 +6333,7 @@ @@ -6169,7 +6320,7 @@
if (!this.isTab(aTab)) { if (!this.isTab(aTab)) {
throw new Error("Can only move a tab into a tab group"); throw new Error("Can only move a tab into a tab group");
} }
@ -645,7 +632,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
return; return;
} }
if (aTab.group && aTab.group.id === aGroup.id) { if (aTab.group && aTab.group.id === aGroup.id) {
@@ -6263,6 +6427,10 @@ @@ -6263,6 +6414,10 @@
moveActionCallback(); moveActionCallback();
@ -656,7 +643,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
// Clear tabs cache after moving nodes because the order of tabs may have // Clear tabs cache after moving nodes because the order of tabs may have
// changed. // changed.
this.tabContainer._invalidateCachedTabs(); this.tabContainer._invalidateCachedTabs();
@@ -7080,7 +7248,7 @@ @@ -7080,7 +7235,7 @@
// preventDefault(). It will still raise the window if appropriate. // preventDefault(). It will still raise the window if appropriate.
break; break;
} }
@ -665,7 +652,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
window.focus(); window.focus();
aEvent.preventDefault(); aEvent.preventDefault();
break; break;
@@ -7981,6 +8149,7 @@ @@ -7981,6 +8136,7 @@
aWebProgress.isTopLevel aWebProgress.isTopLevel
) { ) {
this.mTab.setAttribute("busy", "true"); this.mTab.setAttribute("busy", "true");
@ -673,7 +660,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
gBrowser._tabAttrModified(this.mTab, ["busy"]); gBrowser._tabAttrModified(this.mTab, ["busy"]);
this.mTab._notselectedsinceload = !this.mTab.selected; this.mTab._notselectedsinceload = !this.mTab.selected;
} }
@@ -8954,7 +9123,7 @@ var TabContextMenu = { @@ -8954,7 +9110,7 @@ var TabContextMenu = {
); );
contextUnpinSelectedTabs.hidden = contextUnpinSelectedTabs.hidden =
!this.contextTab.pinned || !this.multiselected; !this.contextTab.pinned || !this.multiselected;
@ -682,7 +669,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..fb26ba8cc858cc730c2fe7539f1d2354
// Move Tab items // Move Tab items
let contextMoveTabOptions = document.getElementById( let contextMoveTabOptions = document.getElementById(
"context_moveTabOptions" "context_moveTabOptions"
@@ -9223,6 +9392,7 @@ var TabContextMenu = { @@ -9223,6 +9379,7 @@ var TabContextMenu = {
telemetrySource: gBrowser.TabMetrics.METRIC_SOURCE.TAB_STRIP, telemetrySource: gBrowser.TabMetrics.METRIC_SOURCE.TAB_STRIP,
}); });
} else { } else {

View file

@ -1,5 +1,5 @@
diff --git a/browser/components/tabbrowser/content/tabs.js b/browser/components/tabbrowser/content/tabs.js diff --git a/browser/components/tabbrowser/content/tabs.js b/browser/components/tabbrowser/content/tabs.js
index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..2885d896c4026278dfcb309f12230d6f86275ada 100644 index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..1a3aa415d08379b00960de398808e771c299f2ca 100644
--- a/browser/components/tabbrowser/content/tabs.js --- a/browser/components/tabbrowser/content/tabs.js
+++ b/browser/components/tabbrowser/content/tabs.js +++ b/browser/components/tabbrowser/content/tabs.js
@@ -83,7 +83,7 @@ @@ -83,7 +83,7 @@
@ -33,7 +33,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..2885d896c4026278dfcb309f12230d6f
// In expanded vertical mode, the max number of pinned tabs per row is dynamic // In expanded vertical mode, the max number of pinned tabs per row is dynamic
// Set this before adjusting dragged tab's position // Set this before adjusting dragged tab's position
- let pinnedTabs = this.visibleTabs.slice(0, gBrowser.pinnedTabCount); - let pinnedTabs = this.visibleTabs.slice(0, gBrowser.pinnedTabCount);
+ let pinnedTabs = this.visibleTabs.filter(tab => !tab.hasAttribute("zen-glance-tab")).slice(0, gBrowser._numZenVisibleEssentials); + let pinnedTabs = this.visibleTabs.filter(tab => !tab.hasAttribute("zen-glance-tab")).slice(0, gBrowser._numZenEssentials);
let tabsPerRow = 0; let tabsPerRow = 0;
let position = 0; let position = 0;
for (let pinnedTab of pinnedTabs) { for (let pinnedTab of pinnedTabs) {
@ -87,8 +87,8 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..2885d896c4026278dfcb309f12230d6f
+ let numPinned = gBrowser._numVisiblePinTabsWithoutCollapsed; + let numPinned = gBrowser._numVisiblePinTabsWithoutCollapsed;
+ let essential = draggedTab.hasAttribute("zen-essential"); + let essential = draggedTab.hasAttribute("zen-essential");
+ let tabs = this.ariaFocusableItems.filter(tab => !tab.hasAttribute("zen-glance-tab")).slice( + let tabs = this.ariaFocusableItems.filter(tab => !tab.hasAttribute("zen-glance-tab")).slice(
+ isPinned ? (essential ? 0 : gBrowser._numZenVisibleEssentials) : numPinned, + isPinned ? (essential ? 0 : gBrowser._numZenEssentials) : numPinned,
+ isPinned ? (essential ? gBrowser._numZenVisibleEssentials : numPinned) : undefined + isPinned ? (essential ? gBrowser._numZenEssentials : numPinned) : undefined
); );
let size = this.verticalMode ? "height" : "width"; let size = this.verticalMode ? "height" : "width";
let screenAxis = this.verticalMode ? "screenY" : "screenX"; let screenAxis = this.verticalMode ? "screenY" : "screenX";
@ -349,7 +349,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..2885d896c4026278dfcb309f12230d6f
} }
- let tabs = this.visibleTabs.slice(0, gBrowser.pinnedTabCount); - let tabs = this.visibleTabs.slice(0, gBrowser.pinnedTabCount);
+ let tabs = this.visibleTabs.filter(tab => !tab.hasAttribute("zen-glance-tab")).slice(0, gBrowser._numZenVisibleEssentials); + let tabs = this.visibleTabs.filter(tab => !tab.hasAttribute("zen-glance-tab")).slice(0, gBrowser._numZenEssentials);
let directionX = screenX > dragData.animLastScreenX; let directionX = screenX > dragData.animLastScreenX;
let directionY = screenY > dragData.animLastScreenY; let directionY = screenY > dragData.animLastScreenY;
@ -375,8 +375,8 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..2885d896c4026278dfcb309f12230d6f
+ let numPinned = gBrowser._numVisiblePinTabsWithoutCollapsed; + let numPinned = gBrowser._numVisiblePinTabsWithoutCollapsed;
+ let essential = draggedTab.hasAttribute("zen-essential"); + let essential = draggedTab.hasAttribute("zen-essential");
+ let tabs = this.ariaFocusableItems.filter(tab => !tab.hasAttribute("zen-glance-tab")).slice( + let tabs = this.ariaFocusableItems.filter(tab => !tab.hasAttribute("zen-glance-tab")).slice(
+ isPinned ? (essential ? 0 : gBrowser._numZenVisibleEssentials) : numPinned, + isPinned ? (essential ? 0 : gBrowser._numZenEssentials) : numPinned,
+ isPinned ? (essential ? gBrowser._numZenVisibleEssentials : numPinned) : undefined + isPinned ? (essential ? gBrowser._numZenEssentials : numPinned) : undefined
); );
+ if (draggedTab.group?.hasAttribute("split-view-group")) { + if (draggedTab.group?.hasAttribute("split-view-group")) {
+ draggedTab = draggedTab.group.labelElement; + draggedTab = draggedTab.group.labelElement;

View file

@ -756,7 +756,8 @@
const isVisible = contextTab.pinned && !contextTab.multiselected; const isVisible = contextTab.pinned && !contextTab.multiselected;
document.getElementById('context_zen-reset-pinned-tab').hidden = !isVisible || !contextTab.getAttribute('zen-pin-id'); document.getElementById('context_zen-reset-pinned-tab').hidden = !isVisible || !contextTab.getAttribute('zen-pin-id');
document.getElementById('context_zen-replace-pinned-url-with-current').hidden = !isVisible; document.getElementById('context_zen-replace-pinned-url-with-current').hidden = !isVisible;
document.getElementById('context_zen-add-essential').hidden = contextTab.getAttribute('zen-essential'); document.getElementById('context_zen-add-essential').hidden =
contextTab.getAttribute('zen-essential') || !!contextTab.group;
document.getElementById('context_zen-remove-essential').hidden = !contextTab.getAttribute('zen-essential'); document.getElementById('context_zen-remove-essential').hidden = !contextTab.getAttribute('zen-essential');
document.getElementById('context_unpinTab').hidden = document.getElementById('context_unpinTab').hidden =
document.getElementById('context_unpinTab').hidden || contextTab.getAttribute('zen-essential'); document.getElementById('context_unpinTab').hidden || contextTab.getAttribute('zen-essential');