forked from ZenBrowserMirrors/zen-desktop
feat: update preferences and UI components for new features and improvements
This commit is contained in:
parent
02c9ec67c0
commit
daf6d6aea8
29 changed files with 357 additions and 511 deletions
|
@ -1,8 +1,8 @@
|
|||
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
|
||||
index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7409d0582 100644
|
||||
index 0dc763824f390b4964489ac4e071ed6d41cc41db..3e0be2c686a162038e99b31fdbcf9832f184a629 100644
|
||||
--- a/browser/components/tabbrowser/content/tabbrowser.js
|
||||
+++ b/browser/components/tabbrowser/content/tabbrowser.js
|
||||
@@ -412,11 +412,50 @@
|
||||
@@ -424,11 +424,50 @@
|
||||
return this.tabContainer.visibleTabs;
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
}
|
||||
return i;
|
||||
}
|
||||
@@ -546,6 +585,7 @@
|
||||
@@ -558,6 +597,7 @@
|
||||
this.tabpanels.appendChild(panel);
|
||||
|
||||
let tab = this.tabs[0];
|
||||
|
@ -63,7 +63,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
tab.linkedPanel = uniqueId;
|
||||
this._selectedTab = tab;
|
||||
this._selectedBrowser = browser;
|
||||
@@ -811,12 +851,13 @@
|
||||
@@ -823,12 +863,13 @@
|
||||
}
|
||||
|
||||
this.showTab(aTab);
|
||||
|
@ -72,7 +72,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
+ const handled = gZenFolders.handleTabPin(aTab);
|
||||
+ if (!handled) this.ungroupTab(aTab);
|
||||
+ if (this.tabContainer.verticalMode && !handled) {
|
||||
this._handleTabMove(aTab, () =>
|
||||
this.#handleTabMove(aTab, () =>
|
||||
- this.verticalPinnedTabsContainer.appendChild(aTab)
|
||||
+ aTab.hasAttribute("zen-essential") ? document.getElementById("zen-essentials-container").appendChild(aTab) : this.verticalPinnedTabsContainer.insertBefore(aTab, this.verticalPinnedTabsContainer.lastChild)
|
||||
);
|
||||
|
@ -81,12 +81,12 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
this.moveTabTo(aTab, this.pinnedTabCount, { forceStandaloneTab: true });
|
||||
}
|
||||
aTab.setAttribute("pinned", "true");
|
||||
@@ -830,12 +871,15 @@
|
||||
@@ -842,12 +883,15 @@
|
||||
}
|
||||
|
||||
if (this.tabContainer.verticalMode) {
|
||||
+ const handled = gZenFolders.handleTabUnpin(aTab);
|
||||
this._handleTabMove(aTab, () => {
|
||||
this.#handleTabMove(aTab, () => {
|
||||
// we remove this attribute first, so that allTabs represents
|
||||
// the moving of a tab from the vertical pinned tabs container
|
||||
// and back into arrowscrollbox.
|
||||
|
@ -98,7 +98,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
});
|
||||
} else {
|
||||
this.moveTabTo(aTab, this.pinnedTabCount - 1, {
|
||||
@@ -1018,6 +1062,8 @@
|
||||
@@ -1030,6 +1074,8 @@
|
||||
|
||||
let LOCAL_PROTOCOLS = ["chrome:", "about:", "resource:", "data:"];
|
||||
|
||||
|
@ -107,7 +107,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
if (
|
||||
aIconURL &&
|
||||
!aLoadingPrincipal &&
|
||||
@@ -1028,6 +1074,9 @@
|
||||
@@ -1040,6 +1086,9 @@
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
|
||||
let browser = this.getBrowserForTab(aTab);
|
||||
browser.mIconURL = aIconURL;
|
||||
@@ -1273,6 +1322,7 @@
|
||||
@@ -1288,6 +1337,7 @@
|
||||
if (!this._previewMode) {
|
||||
newTab.recordTimeFromUnloadToReload();
|
||||
newTab.updateLastAccessed();
|
||||
|
@ -125,7 +125,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
oldTab.updateLastAccessed();
|
||||
// if this is the foreground window, update the last-seen timestamps.
|
||||
if (this.ownerGlobal == BrowserWindowTracker.getTopWindow()) {
|
||||
@@ -1425,6 +1475,9 @@
|
||||
@@ -1440,6 +1490,9 @@
|
||||
}
|
||||
|
||||
let activeEl = document.activeElement;
|
||||
|
@ -135,7 +135,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
// If focus is on the old tab, move it to the new tab.
|
||||
if (activeEl == oldTab) {
|
||||
newTab.focus();
|
||||
@@ -1748,7 +1801,7 @@
|
||||
@@ -1763,7 +1816,7 @@
|
||||
}
|
||||
|
||||
_setTabLabel(aTab, aLabel, { beforeTabOpen, isContentTitle, isURL } = {}) {
|
||||
|
@ -144,7 +144,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
return false;
|
||||
}
|
||||
|
||||
@@ -1851,7 +1904,7 @@
|
||||
@@ -1866,7 +1919,7 @@
|
||||
newIndex = this.selectedTab._tPos + 1;
|
||||
}
|
||||
|
||||
|
@ -153,7 +153,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
let browser;
|
||||
if (targetTab) {
|
||||
browser = this.getBrowserForTab(targetTab);
|
||||
@@ -2108,6 +2161,7 @@
|
||||
@@ -2123,6 +2176,7 @@
|
||||
uriIsAboutBlank,
|
||||
userContextId,
|
||||
skipLoad,
|
||||
|
@ -161,7 +161,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
} = {}) {
|
||||
let b = document.createXULElement("browser");
|
||||
// Use the JSM global to create the permanentKey, so that if the
|
||||
@@ -2181,8 +2235,7 @@
|
||||
@@ -2196,8 +2250,7 @@
|
||||
// we use a different attribute name for this?
|
||||
b.setAttribute("name", name);
|
||||
}
|
||||
|
@ -171,7 +171,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
b.setAttribute("transparent", "true");
|
||||
}
|
||||
|
||||
@@ -2347,7 +2400,7 @@
|
||||
@@ -2374,7 +2427,7 @@
|
||||
|
||||
let panel = this.getPanel(browser);
|
||||
let uniqueId = this._generateUniquePanelID();
|
||||
|
@ -180,7 +180,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
aTab.linkedPanel = uniqueId;
|
||||
|
||||
// Inject the <browser> into the DOM if necessary.
|
||||
@@ -2406,8 +2459,8 @@
|
||||
@@ -2433,8 +2486,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) {
|
||||
|
@ -191,7 +191,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
} else {
|
||||
aTab.linkedBrowser.browsingContext.hasSiblings = this.tabs.length > 1;
|
||||
}
|
||||
@@ -2629,6 +2682,7 @@
|
||||
@@ -2656,6 +2709,7 @@
|
||||
schemelessInput,
|
||||
hasValidUserGestureActivation = false,
|
||||
textDirectiveUserActivation = false,
|
||||
|
@ -199,7 +199,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
} = {}
|
||||
) {
|
||||
// all callers of addTab that pass a params object need to pass
|
||||
@@ -2639,6 +2693,12 @@
|
||||
@@ -2666,6 +2720,12 @@
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -212,7 +212,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
if (!UserInteraction.running("browser.tabs.opening", window)) {
|
||||
UserInteraction.start("browser.tabs.opening", "initting", window);
|
||||
}
|
||||
@@ -2702,6 +2762,15 @@
|
||||
@@ -2729,6 +2789,15 @@
|
||||
noInitialLabel,
|
||||
skipBackgroundNotify,
|
||||
});
|
||||
|
@ -228,7 +228,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
if (insertTab) {
|
||||
// insert the tab into the tab container in the correct position
|
||||
this._insertTabAtIndex(t, {
|
||||
@@ -2726,6 +2795,7 @@
|
||||
@@ -2753,6 +2822,7 @@
|
||||
initialBrowsingContextGroupId,
|
||||
openWindowInfo,
|
||||
skipLoad,
|
||||
|
@ -236,7 +236,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
}));
|
||||
|
||||
if (focusUrlBar) {
|
||||
@@ -2845,6 +2915,9 @@
|
||||
@@ -2872,6 +2942,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -246,7 +246,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
// Additionally send pinned tab events
|
||||
if (pinned) {
|
||||
this._notifyPinnedStatus(t);
|
||||
@@ -2865,12 +2938,15 @@
|
||||
@@ -2892,12 +2965,15 @@
|
||||
* @param {string} [label=]
|
||||
* @returns {MozTabbrowserTabGroup}
|
||||
*/
|
||||
|
@ -263,15 +263,15 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
return group;
|
||||
}
|
||||
|
||||
@@ -2904,6 +2980,7 @@
|
||||
label = "",
|
||||
@@ -2938,6 +3014,7 @@
|
||||
insertBefore = null,
|
||||
showCreateUI = false,
|
||||
isUserCreated = false,
|
||||
telemetryUserCreateSource = "unknown",
|
||||
+ forSplitView = false,
|
||||
} = {}
|
||||
) {
|
||||
if (!tabs?.length) {
|
||||
@@ -2918,7 +2995,12 @@
|
||||
@@ -2952,7 +3029,12 @@
|
||||
id = `${Date.now()}-${Math.round(Math.random() * 100)}`;
|
||||
}
|
||||
let group = this._createTabGroup(id, color, false, label);
|
||||
|
@ -285,7 +285,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
group,
|
||||
insertBefore?.group ?? insertBefore
|
||||
);
|
||||
@@ -3126,6 +3208,7 @@
|
||||
@@ -3269,6 +3351,7 @@
|
||||
initialBrowsingContextGroupId,
|
||||
openWindowInfo,
|
||||
skipLoad,
|
||||
|
@ -293,7 +293,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
}
|
||||
) {
|
||||
// If we don't have a preferred remote type, and we have a remote
|
||||
@@ -3189,6 +3272,7 @@
|
||||
@@ -3332,6 +3415,7 @@
|
||||
openWindowInfo,
|
||||
name,
|
||||
skipLoad,
|
||||
|
@ -301,7 +301,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
});
|
||||
}
|
||||
|
||||
@@ -3367,6 +3451,27 @@
|
||||
@@ -3510,6 +3594,27 @@
|
||||
) {
|
||||
tabWasReused = true;
|
||||
tab = this.selectedTab;
|
||||
|
@ -329,7 +329,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
if (!tabData.pinned) {
|
||||
this.unpinTab(tab);
|
||||
} else {
|
||||
@@ -3380,6 +3485,7 @@
|
||||
@@ -3523,6 +3628,7 @@
|
||||
restoreTabsLazily && !select && !tabData.pinned;
|
||||
|
||||
let url = "about:blank";
|
||||
|
@ -337,7 +337,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
if (tabData.entries?.length) {
|
||||
let activeIndex = (tabData.index || tabData.entries.length) - 1;
|
||||
// Ensure the index is in bounds.
|
||||
@@ -3415,7 +3521,27 @@
|
||||
@@ -3558,7 +3664,27 @@
|
||||
skipLoad: true,
|
||||
preferredRemoteType,
|
||||
});
|
||||
|
@ -366,7 +366,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
if (select) {
|
||||
tabToSelect = tab;
|
||||
}
|
||||
@@ -3428,8 +3554,8 @@
|
||||
@@ -3571,8 +3697,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) {
|
||||
|
@ -377,7 +377,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
tab.toggleAttribute("pinned", true);
|
||||
this.tabContainer._invalidateCachedTabs();
|
||||
// Then ensure all the tab open/pinning information is sent.
|
||||
@@ -3439,7 +3565,8 @@
|
||||
@@ -3582,7 +3708,8 @@
|
||||
// needs calling:
|
||||
shouldUpdateForPinnedTabs = true;
|
||||
}
|
||||
|
@ -387,7 +387,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
let { groupId } = tabData;
|
||||
const tabGroup = tabGroupWorkingData.get(groupId);
|
||||
// if a tab refers to a tab group we don't know, skip any group
|
||||
@@ -3453,7 +3580,10 @@
|
||||
@@ -3596,7 +3723,10 @@
|
||||
tabGroup.stateData.id,
|
||||
tabGroup.stateData.color,
|
||||
tabGroup.stateData.collapsed,
|
||||
|
@ -399,7 +399,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
);
|
||||
tabsFragment.appendChild(tabGroup.node);
|
||||
}
|
||||
@@ -3504,6 +3634,9 @@
|
||||
@@ -3647,6 +3777,9 @@
|
||||
this.selectedTab = tabToSelect;
|
||||
this.removeTab(leftoverTab);
|
||||
}
|
||||
|
@ -409,7 +409,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
|
||||
if (tabs.length > 1 || !tabs[0].selected) {
|
||||
this._updateTabsAfterInsert();
|
||||
@@ -3693,7 +3826,7 @@
|
||||
@@ -3831,7 +3964,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.
|
||||
|
@ -418,7 +418,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
if (
|
||||
!bulkOrderedOpen &&
|
||||
((openerTab &&
|
||||
@@ -3736,18 +3869,18 @@
|
||||
@@ -3877,18 +4010,18 @@
|
||||
|
||||
// Ensure index is within bounds.
|
||||
if (tab.pinned) {
|
||||
|
@ -441,7 +441,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
if (tabAfter && tabAfter.group == tabGroup) {
|
||||
// Place at the front of, or between tabs in, the same tab group
|
||||
this.tabContainer.insertBefore(tab, tabAfter);
|
||||
@@ -4059,6 +4192,9 @@
|
||||
@@ -4200,6 +4333,9 @@
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -451,7 +451,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
this.removeTabs(selectedTabs);
|
||||
}
|
||||
|
||||
@@ -4391,6 +4527,7 @@
|
||||
@@ -4557,6 +4693,7 @@
|
||||
skipSessionStore,
|
||||
} = {}
|
||||
) {
|
||||
|
@ -459,7 +459,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
if (UserInteraction.running("browser.tabs.opening", window)) {
|
||||
UserInteraction.finish("browser.tabs.opening", window);
|
||||
}
|
||||
@@ -4407,6 +4544,12 @@
|
||||
@@ -4573,6 +4710,12 @@
|
||||
TelemetryStopwatch.start("FX_TAB_CLOSE_TIME_NO_ANIM_MS", aTab);
|
||||
}
|
||||
|
||||
|
@ -472,7 +472,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
// Handle requests for synchronously removing an already
|
||||
// asynchronously closing tab.
|
||||
if (!animate && aTab.closing) {
|
||||
@@ -4421,7 +4564,9 @@
|
||||
@@ -4587,7 +4730,9 @@
|
||||
// frame created for it (for example, by updating the visually selected
|
||||
// state).
|
||||
let tabWidth = window.windowUtils.getBoundsWithoutFlushing(aTab).width;
|
||||
|
@ -483,7 +483,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
if (
|
||||
!this._beginRemoveTab(aTab, {
|
||||
closeWindowFastpath: true,
|
||||
@@ -4435,7 +4580,6 @@
|
||||
@@ -4601,7 +4746,6 @@
|
||||
TelemetryStopwatch.cancel("FX_TAB_CLOSE_TIME_NO_ANIM_MS", aTab);
|
||||
return;
|
||||
}
|
||||
|
@ -491,7 +491,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
let lockTabSizing =
|
||||
!this.tabContainer.verticalMode &&
|
||||
!aTab.pinned &&
|
||||
@@ -4574,14 +4718,14 @@
|
||||
@@ -4740,14 +4884,14 @@
|
||||
!!this.tabsInCollapsedTabGroups.length;
|
||||
if (
|
||||
aTab.visible &&
|
||||
|
@ -508,7 +508,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
|
||||
if (closeWindow) {
|
||||
// We've already called beforeunload on all the relevant tabs if we get here,
|
||||
@@ -4605,6 +4749,7 @@
|
||||
@@ -4771,6 +4915,7 @@
|
||||
|
||||
newTab = true;
|
||||
}
|
||||
|
@ -516,7 +516,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
aTab._endRemoveArgs = [closeWindow, newTab];
|
||||
|
||||
// swapBrowsersAndCloseOther will take care of closing the window without animation.
|
||||
@@ -4645,9 +4790,7 @@
|
||||
@@ -4811,9 +4956,7 @@
|
||||
aTab._mouseleave();
|
||||
|
||||
if (newTab) {
|
||||
|
@ -527,7 +527,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
} else {
|
||||
TabBarVisibility.update();
|
||||
}
|
||||
@@ -4776,6 +4919,8 @@
|
||||
@@ -4942,6 +5085,8 @@
|
||||
this.tabs[i]._tPos = i;
|
||||
}
|
||||
|
||||
|
@ -536,7 +536,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
if (!this._windowIsClosing) {
|
||||
if (wasPinned) {
|
||||
this.tabContainer._positionPinnedTabs();
|
||||
@@ -4994,7 +5139,7 @@
|
||||
@@ -5160,7 +5305,7 @@
|
||||
!excludeTabs.has(aTab.owner) &&
|
||||
Services.prefs.getBoolPref("browser.tabs.selectOwnerOnClose")
|
||||
) {
|
||||
|
@ -545,7 +545,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
}
|
||||
|
||||
// Try to find a remaining tab that comes after the given tab
|
||||
@@ -5016,7 +5161,7 @@
|
||||
@@ -5182,7 +5327,7 @@
|
||||
}
|
||||
|
||||
if (tab) {
|
||||
|
@ -554,7 +554,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
}
|
||||
|
||||
// If no qualifying visible tab was found, see if there is a tab in
|
||||
@@ -5434,10 +5579,10 @@
|
||||
@@ -5600,10 +5745,10 @@
|
||||
SessionStore.deleteCustomTabValue(aTab, "hiddenBy");
|
||||
}
|
||||
|
||||
|
@ -567,8 +567,8 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
aTab.selected ||
|
||||
aTab.closing ||
|
||||
// Tabs that are sharing the screen, microphone or camera cannot be hidden.
|
||||
@@ -5675,7 +5820,7 @@
|
||||
|
||||
@@ -5839,7 +5984,7 @@
|
||||
moveTabTo(aTab, aIndex, { forceStandaloneTab = false } = {}) {
|
||||
// Don't allow mixing pinned and unpinned tabs.
|
||||
if (aTab.pinned) {
|
||||
- aIndex = Math.min(aIndex, this.pinnedTabCount - 1);
|
||||
|
@ -576,16 +576,16 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
} else {
|
||||
aIndex = Math.max(aIndex, this.pinnedTabCount);
|
||||
}
|
||||
@@ -5685,10 +5830,17 @@
|
||||
@@ -5849,10 +5994,17 @@
|
||||
|
||||
this._handleTabMove(aTab, () => {
|
||||
this.#handleTabMove(aTab, () => {
|
||||
let neighbor = this.tabs[aIndex];
|
||||
- if (forceStandaloneTab && neighbor.group) {
|
||||
+ const _tPos = aTab._tPos;
|
||||
+ if ((forceStandaloneTab && neighbor.group) || neighbor.group?.hasAttribute("split-view-group")) {
|
||||
neighbor = neighbor.group;
|
||||
}
|
||||
- if (neighbor && aIndex >= aTab._tPos) {
|
||||
- if (neighbor && aIndex > aTab._tPos) {
|
||||
+ if (aTab.group?.hasAttribute("split-view-group")) {
|
||||
+ aTab = aTab.group;
|
||||
+ }
|
||||
|
@ -596,7 +596,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
neighbor.after(aTab);
|
||||
} else {
|
||||
this.tabContainer.insertBefore(aTab, neighbor);
|
||||
@@ -5697,7 +5849,7 @@
|
||||
@@ -5938,7 +6090,7 @@
|
||||
}
|
||||
|
||||
moveTabToGroup(aTab, aGroup) {
|
||||
|
@ -605,7 +605,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
return;
|
||||
}
|
||||
if (aTab.group && aTab.group.id === aGroup.id) {
|
||||
@@ -5721,6 +5873,10 @@
|
||||
@@ -5962,6 +6114,10 @@
|
||||
|
||||
moveActionCallback();
|
||||
|
||||
|
@ -616,7 +616,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
// Clear tabs cache after moving nodes because the order of tabs may have
|
||||
// changed.
|
||||
this.tabContainer._invalidateCachedTabs();
|
||||
@@ -5771,7 +5927,7 @@
|
||||
@@ -6016,7 +6172,7 @@
|
||||
createLazyBrowser,
|
||||
};
|
||||
|
||||
|
@ -625,7 +625,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
if (aIndex < numPinned || (aTab.pinned && aIndex == numPinned)) {
|
||||
params.pinned = true;
|
||||
}
|
||||
@@ -6513,7 +6669,7 @@
|
||||
@@ -6766,7 +6922,7 @@
|
||||
// preventDefault(). It will still raise the window if appropriate.
|
||||
break;
|
||||
}
|
||||
|
@ -634,7 +634,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
window.focus();
|
||||
aEvent.preventDefault();
|
||||
break;
|
||||
@@ -7415,6 +7571,7 @@
|
||||
@@ -7672,6 +7828,7 @@
|
||||
aWebProgress.isTopLevel
|
||||
) {
|
||||
this.mTab.setAttribute("busy", "true");
|
||||
|
@ -642,25 +642,25 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7
|
|||
gBrowser._tabAttrModified(this.mTab, ["busy"]);
|
||||
this.mTab._notselectedsinceload = !this.mTab.selected;
|
||||
}
|
||||
@@ -8381,7 +8538,7 @@ var TabContextMenu = {
|
||||
@@ -8641,7 +8798,7 @@ var TabContextMenu = {
|
||||
);
|
||||
contextUnpinSelectedTabs.hidden =
|
||||
!this.contextTab.pinned || !multiselectionContext;
|
||||
!this.contextTab.pinned || !this.multiselected;
|
||||
-
|
||||
+ gZenPinnedTabManager.updatePinnedTabContextMenu(this.contextTab);
|
||||
// Move Tab items
|
||||
let contextMoveTabOptions = document.getElementById(
|
||||
"context_moveTabOptions"
|
||||
@@ -8414,7 +8571,7 @@ var TabContextMenu = {
|
||||
let contextMoveTabToStart = document.getElementById("context_moveToStart");
|
||||
@@ -8675,7 +8832,7 @@ var TabContextMenu = {
|
||||
let isFirstTab =
|
||||
tabsToMove[0] == visibleTabs[0] ||
|
||||
- tabsToMove[0] == visibleTabs[gBrowser.pinnedTabCount];
|
||||
+ tabsToMove[0] == visibleTabs[gBrowser._numVisiblePinTabs];
|
||||
!this.contextTabs[0].group &&
|
||||
(this.contextTabs[0] == visibleTabs[0] ||
|
||||
- this.contextTabs[0] == visibleTabs[gBrowser.pinnedTabCount]);
|
||||
+ this.contextTabs[0] == visibleTabs[gBrowser._numVisiblePinTabs];
|
||||
contextMoveTabToStart.disabled = isFirstTab && allSelectedTabsAdjacent;
|
||||
|
||||
document.getElementById("context_openTabInWindow").disabled =
|
||||
@@ -8647,6 +8804,7 @@ var TabContextMenu = {
|
||||
@@ -8905,6 +9062,7 @@ var TabContextMenu = {
|
||||
if (this.contextTab.multiselected) {
|
||||
gBrowser.removeMultiSelectedTabs();
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue