Added support for split views persisting between sessions

This commit is contained in:
mr. M
2025-03-24 23:58:06 +01:00
parent bd5d3c00f1
commit 342186584e
10 changed files with 184 additions and 53 deletions

View File

@@ -58,6 +58,11 @@ tab-group[split-view-group] {
right: 50%;
transform: translateX(50%);
}
& .tab-content {
min-width: 0;
justify-content: unset !important;
}
}
&:has(> tab:is([visuallyselected], [multiselected])) {

View File

@@ -365,7 +365,7 @@ menuitem {
}
& .zen-toast {
padding: 0.9rem 0.8rem;
padding: 0.5rem 0.6rem;
border-radius: 12px;
background: linear-gradient(
170deg,

View File

@@ -1722,6 +1722,33 @@ class ZenViewSplitter extends ZenDOMOperatedFeature {
return null;
}
storeDataForSessionStore() {
// We cant store any tab or browser elements in the session store
// so we need to store the tab indexes and group indexes
const data = this._data.map((group) => {
return {
groupId: group.tabs[0].group?.id,
gridType: group.gridType,
};
});
return data;
}
restoreDataFromSessionStore(data) {
if (!data) {
return;
}
// We can just get the tab group with document.getElementById(group.groupId)
// and add the tabs to it
for (const group of data) {
const groupElement = document.getElementById(group.groupId);
if (groupElement) {
const tabs = groupElement.querySelectorAll('tab');
this.splitTabs([...tabs], group.gridType);
}
}
}
}
window.gZenViewSplitter = new ZenViewSplitter();

View File

@@ -263,12 +263,13 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
_organizeTabsToWorkspaceSections(workspace, section, pinnedSection, tabs) {
const workspaceTabs = Array.from(tabs).filter((tab) => tab.getAttribute('zen-workspace-id') === workspace.uuid);
let firstNormalTab = null;
for (const tab of workspaceTabs) {
for (let tab of workspaceTabs) {
if (tab.hasAttribute('zen-essential')) {
continue; // Ignore essentials as they need to be in their own section
}
// remove tab from list
tabs.splice(tabs.indexOf(tab), 1);
tab = tab.group ?? tab;
if (tab.pinned) {
pinnedSection.insertBefore(tab, pinnedSection.nextSibling);
} else {
@@ -2323,6 +2324,23 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
return this._allStoredTabs;
}
get allTabGroups() {
if (!this._hasInitializedTabsStrip) {
let children = this.tabboxChildren;
return children.filter((node) => node.tagName == 'tab-group');
}
const pinnedContainers = document.querySelectorAll('#vertical-pinned-tabs-container .zen-workspace-tabs-section');
const normalContainers = document.querySelectorAll('#tabbrowser-arrowscrollbox .zen-workspace-tabs-section');
const containers = [...pinnedContainers, ...normalContainers];
const tabGroups = [];
for (const container of containers) {
for (const tabGroup of container.querySelectorAll('tab-group')) {
tabGroups.push(tabGroup);
}
}
return tabGroups;
}
get allUsedBrowsers() {
if (!this._hasInitializedTabsStrip) {
return gBrowser.browsers;

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/sessionstore/SessionStore.sys.mjs b/browser/components/sessionstore/SessionStore.sys.mjs
index f814772114948f87cbb3c3a7231c95ea1f68d776..ae35daa518ca25f4fc95ef983519c390bf088a68 100644
index f814772114948f87cbb3c3a7231c95ea1f68d776..ee358a46956d5f09983fa98a202085bac69c8b27 100644
--- a/browser/components/sessionstore/SessionStore.sys.mjs
+++ b/browser/components/sessionstore/SessionStore.sys.mjs
@@ -3171,7 +3171,7 @@ var SessionStoreInternal = {
@@ -19,7 +19,7 @@ index f814772114948f87cbb3c3a7231c95ea1f68d776..ae35daa518ca25f4fc95ef983519c390
if (inBackground === false) {
aWindow.gBrowser.selectedTab = newTab;
@@ -5355,14 +5356,14 @@ var SessionStoreInternal = {
@@ -5355,14 +5356,15 @@ var SessionStoreInternal = {
}
let tabbrowser = aWindow.gBrowser;
@@ -29,6 +29,7 @@ index f814772114948f87cbb3c3a7231c95ea1f68d776..ae35daa518ca25f4fc95ef983519c390
let winData = this._windows[aWindow.__SSi];
let tabsData = (winData.tabs = []);
+ winData.splitViewData = aWindow.gZenViewSplitter?.storeDataForSessionStore();
// update the internal state data for this window
for (let tab of tabs) {
- if (tab == aWindow.FirefoxViewHandler.tab) {
@@ -36,7 +37,7 @@ index f814772114948f87cbb3c3a7231c95ea1f68d776..ae35daa518ca25f4fc95ef983519c390
continue;
}
let tabData = lazy.TabState.collect(tab, TAB_CUSTOM_VALUES.get(tab));
@@ -5381,7 +5382,7 @@ var SessionStoreInternal = {
@@ -5381,7 +5383,7 @@ var SessionStoreInternal = {
// We don't store the Firefox View tab in Session Store, so if it was the last selected "tab" when
// a window is closed, point to the first item in the tab strip instead (it will never be the Firefox View tab,
// since it's only inserted into the tab strip after it's selected).
@@ -45,7 +46,26 @@ index f814772114948f87cbb3c3a7231c95ea1f68d776..ae35daa518ca25f4fc95ef983519c390
selectedIndex = 1;
winData.title = tabbrowser.tabs[0].label;
}
@@ -6086,8 +6087,23 @@ var SessionStoreInternal = {
@@ -5538,6 +5540,7 @@ var SessionStoreInternal = {
winData.tabs,
winData.groups ?? []
);
+ aWindow.gZenViewSplitter?.restoreDataFromSessionStore(winData.splitViewData);
this._log.debug(
`restoreWindow, createTabsForSessionRestore returned ${tabs.length} tabs`
);
@@ -5933,8 +5936,8 @@ var SessionStoreInternal = {
let isRemotenessUpdate = options.isRemotenessUpdate;
let willRestoreImmediately =
- options.restoreImmediately || tabbrowser.selectedBrowser == browser;
-
+ options.restoreImmediately || tabbrowser.selectedBrowser == browser
+ || (tabbrowser.selectedTab.group?.id == tab.group?.id);
let isBrowserInserted = browser.isConnected;
// Increase the busy state counter before modifying the tab.
@@ -6086,8 +6089,23 @@ var SessionStoreInternal = {
// Most of tabData has been restored, now continue with restoring
// attributes that may trigger external events.

View File

@@ -0,0 +1,14 @@
diff --git a/browser/components/sessionstore/TabGroupState.sys.mjs b/browser/components/sessionstore/TabGroupState.sys.mjs
index 2406837c67d8ff590aa0db6c75ede81e53097506..b69fb7862cd76c891ef61e29aca8c10bab2f5d7e 100644
--- a/browser/components/sessionstore/TabGroupState.sys.mjs
+++ b/browser/components/sessionstore/TabGroupState.sys.mjs
@@ -66,6 +66,9 @@ class _TabGroupState {
name: tabGroup.label,
color: tabGroup.color,
collapsed: tabGroup.collapsed,
+ pinned: tabGroup.pinned,
+ essential: tabGroup.essential,
+ splitView: tabGroup.hasAttribute("split-view-group"),
};
}

View File

@@ -1,13 +1,8 @@
diff --git a/browser/components/sessionstore/TabState.sys.mjs b/browser/components/sessionstore/TabState.sys.mjs
index 8f7ed557e6aa61e7e16ed4a8d785ad5fe651b3d8..aff63696d198055886960072a6130318e099ae42 100644
index 8f7ed557e6aa61e7e16ed4a8d785ad5fe651b3d8..254849e13f7566029dc780c45e376e0f0d427cb5 100644
--- a/browser/components/sessionstore/TabState.sys.mjs
+++ b/browser/components/sessionstore/TabState.sys.mjs
@@ -80,10 +80,20 @@ class _TabState {
tabData.muteReason = tab.muteReason;
}
- if (tab.group) {
+ if (tab.group && !tab.group.hasAttribute("split-view-group")) {
@@ -84,6 +84,16 @@ class _TabState {
tabData.groupId = tab.group.id;
}

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
index 628aa6596627c85efe361fc1ece8fd58f7ee653e..06a4aae50ebe8a42d08d4689d8e80a63af1fa8a3 100644
index 628aa6596627c85efe361fc1ece8fd58f7ee653e..2a9ac30c7e270586ff4502046e5b1ae7409d0582 100644
--- a/browser/components/tabbrowser/content/tabbrowser.js
+++ b/browser/components/tabbrowser/content/tabbrowser.js
@@ -412,11 +412,50 @@
@@ -246,7 +246,24 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..06a4aae50ebe8a42d08d4689d8e80a63
// Additionally send pinned tab events
if (pinned) {
this._notifyPinnedStatus(t);
@@ -2904,6 +2977,7 @@
@@ -2865,12 +2938,15 @@
* @param {string} [label=]
* @returns {MozTabbrowserTabGroup}
*/
- _createTabGroup(id, color, collapsed, label = "") {
+ _createTabGroup(id, color, collapsed, label = "", pinned = false, essential = false, splitViewGroup = false) {
let group = document.createXULElement("tab-group", { is: "tab-group" });
group.id = id;
group.collapsed = collapsed;
group.color = color;
group.label = label;
+ group.pinned = pinned;
+ group.essential = essential;
+ if (splitViewGroup) group.setAttribute('split-view-group', true);
return group;
}
@@ -2904,6 +2980,7 @@
label = "",
insertBefore = null,
showCreateUI = false,
@@ -254,7 +271,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..06a4aae50ebe8a42d08d4689d8e80a63
} = {}
) {
if (!tabs?.length) {
@@ -2918,7 +2992,12 @@
@@ -2918,7 +2995,12 @@
id = `${Date.now()}-${Math.round(Math.random() * 100)}`;
}
let group = this._createTabGroup(id, color, false, label);
@@ -264,11 +281,11 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..06a4aae50ebe8a42d08d4689d8e80a63
+ }
+ group.essential = tabs.some(tab => tab.hasAttribute("essential"));
+ group.pinned = group.essential || tabs.some(tab => tab.pinned);
+ (group.essential ? document.getElementById("zen-essentials-container") : (group.pinned ? this.verticalPinnedTabsContainer : this.tabContainer)).insertBefore(
+ ((insertBefore?.group ?? insertBefore).parentNode).insertBefore(
group,
insertBefore?.group ?? insertBefore
);
@@ -3126,6 +3205,7 @@
@@ -3126,6 +3208,7 @@
initialBrowsingContextGroupId,
openWindowInfo,
skipLoad,
@@ -276,7 +293,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..06a4aae50ebe8a42d08d4689d8e80a63
}
) {
// If we don't have a preferred remote type, and we have a remote
@@ -3189,6 +3269,7 @@
@@ -3189,6 +3272,7 @@
openWindowInfo,
name,
skipLoad,
@@ -284,7 +301,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..06a4aae50ebe8a42d08d4689d8e80a63
});
}
@@ -3367,6 +3448,27 @@
@@ -3367,6 +3451,27 @@
) {
tabWasReused = true;
tab = this.selectedTab;
@@ -312,7 +329,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..06a4aae50ebe8a42d08d4689d8e80a63
if (!tabData.pinned) {
this.unpinTab(tab);
} else {
@@ -3380,6 +3482,7 @@
@@ -3380,6 +3485,7 @@
restoreTabsLazily && !select && !tabData.pinned;
let url = "about:blank";
@@ -320,7 +337,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..06a4aae50ebe8a42d08d4689d8e80a63
if (tabData.entries?.length) {
let activeIndex = (tabData.index || tabData.entries.length) - 1;
// Ensure the index is in bounds.
@@ -3415,7 +3518,27 @@
@@ -3415,7 +3521,27 @@
skipLoad: true,
preferredRemoteType,
});
@@ -349,7 +366,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..06a4aae50ebe8a42d08d4689d8e80a63
if (select) {
tabToSelect = tab;
}
@@ -3428,8 +3551,8 @@
@@ -3428,8 +3554,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) {
@@ -360,7 +377,29 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..06a4aae50ebe8a42d08d4689d8e80a63
tab.toggleAttribute("pinned", true);
this.tabContainer._invalidateCachedTabs();
// Then ensure all the tab open/pinning information is sent.
@@ -3504,6 +3627,9 @@
@@ -3439,7 +3565,8 @@
// needs calling:
shouldUpdateForPinnedTabs = true;
}
- } else if (tabData.groupId) {
+ }
+ if (tabData.groupId) {
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 @@
tabGroup.stateData.id,
tabGroup.stateData.color,
tabGroup.stateData.collapsed,
- tabGroup.stateData.name
+ tabGroup.stateData.name,
+ tabGroup.stateData.pinned,
+ tabGroup.stateData.essential,
+ tabGroup.stateData.splitView,
);
tabsFragment.appendChild(tabGroup.node);
}
@@ -3504,6 +3634,9 @@
this.selectedTab = tabToSelect;
this.removeTab(leftoverTab);
}
@@ -370,7 +409,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..06a4aae50ebe8a42d08d4689d8e80a63
if (tabs.length > 1 || !tabs[0].selected) {
this._updateTabsAfterInsert();
@@ -3693,7 +3819,7 @@
@@ -3693,7 +3826,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.
@@ -379,7 +418,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..06a4aae50ebe8a42d08d4689d8e80a63
if (
!bulkOrderedOpen &&
((openerTab &&
@@ -3736,18 +3862,18 @@
@@ -3736,18 +3869,18 @@
// Ensure index is within bounds.
if (tab.pinned) {
@@ -402,7 +441,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..06a4aae50ebe8a42d08d4689d8e80a63
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 +4185,9 @@
@@ -4059,6 +4192,9 @@
return;
}
@@ -412,7 +451,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..06a4aae50ebe8a42d08d4689d8e80a63
this.removeTabs(selectedTabs);
}
@@ -4391,6 +4520,7 @@
@@ -4391,6 +4527,7 @@
skipSessionStore,
} = {}
) {
@@ -420,7 +459,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..06a4aae50ebe8a42d08d4689d8e80a63
if (UserInteraction.running("browser.tabs.opening", window)) {
UserInteraction.finish("browser.tabs.opening", window);
}
@@ -4407,6 +4537,12 @@
@@ -4407,6 +4544,12 @@
TelemetryStopwatch.start("FX_TAB_CLOSE_TIME_NO_ANIM_MS", aTab);
}
@@ -433,7 +472,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..06a4aae50ebe8a42d08d4689d8e80a63
// Handle requests for synchronously removing an already
// asynchronously closing tab.
if (!animate && aTab.closing) {
@@ -4421,7 +4557,9 @@
@@ -4421,7 +4564,9 @@
// frame created for it (for example, by updating the visually selected
// state).
let tabWidth = window.windowUtils.getBoundsWithoutFlushing(aTab).width;
@@ -444,7 +483,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..06a4aae50ebe8a42d08d4689d8e80a63
if (
!this._beginRemoveTab(aTab, {
closeWindowFastpath: true,
@@ -4435,7 +4573,6 @@
@@ -4435,7 +4580,6 @@
TelemetryStopwatch.cancel("FX_TAB_CLOSE_TIME_NO_ANIM_MS", aTab);
return;
}
@@ -452,7 +491,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..06a4aae50ebe8a42d08d4689d8e80a63
let lockTabSizing =
!this.tabContainer.verticalMode &&
!aTab.pinned &&
@@ -4574,14 +4711,14 @@
@@ -4574,14 +4718,14 @@
!!this.tabsInCollapsedTabGroups.length;
if (
aTab.visible &&
@@ -469,7 +508,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..06a4aae50ebe8a42d08d4689d8e80a63
if (closeWindow) {
// We've already called beforeunload on all the relevant tabs if we get here,
@@ -4605,6 +4742,7 @@
@@ -4605,6 +4749,7 @@
newTab = true;
}
@@ -477,7 +516,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..06a4aae50ebe8a42d08d4689d8e80a63
aTab._endRemoveArgs = [closeWindow, newTab];
// swapBrowsersAndCloseOther will take care of closing the window without animation.
@@ -4645,9 +4783,7 @@
@@ -4645,9 +4790,7 @@
aTab._mouseleave();
if (newTab) {
@@ -488,7 +527,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..06a4aae50ebe8a42d08d4689d8e80a63
} else {
TabBarVisibility.update();
}
@@ -4776,6 +4912,8 @@
@@ -4776,6 +4919,8 @@
this.tabs[i]._tPos = i;
}
@@ -497,7 +536,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..06a4aae50ebe8a42d08d4689d8e80a63
if (!this._windowIsClosing) {
if (wasPinned) {
this.tabContainer._positionPinnedTabs();
@@ -4994,7 +5132,7 @@
@@ -4994,7 +5139,7 @@
!excludeTabs.has(aTab.owner) &&
Services.prefs.getBoolPref("browser.tabs.selectOwnerOnClose")
) {
@@ -506,7 +545,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..06a4aae50ebe8a42d08d4689d8e80a63
}
// Try to find a remaining tab that comes after the given tab
@@ -5016,7 +5154,7 @@
@@ -5016,7 +5161,7 @@
}
if (tab) {
@@ -515,7 +554,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..06a4aae50ebe8a42d08d4689d8e80a63
}
// If no qualifying visible tab was found, see if there is a tab in
@@ -5434,10 +5572,10 @@
@@ -5434,10 +5579,10 @@
SessionStore.deleteCustomTabValue(aTab, "hiddenBy");
}
@@ -528,7 +567,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..06a4aae50ebe8a42d08d4689d8e80a63
aTab.selected ||
aTab.closing ||
// Tabs that are sharing the screen, microphone or camera cannot be hidden.
@@ -5675,7 +5813,7 @@
@@ -5675,7 +5820,7 @@
// Don't allow mixing pinned and unpinned tabs.
if (aTab.pinned) {
@@ -537,7 +576,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..06a4aae50ebe8a42d08d4689d8e80a63
} else {
aIndex = Math.max(aIndex, this.pinnedTabCount);
}
@@ -5685,10 +5823,17 @@
@@ -5685,10 +5830,17 @@
this._handleTabMove(aTab, () => {
let neighbor = this.tabs[aIndex];
@@ -557,7 +596,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..06a4aae50ebe8a42d08d4689d8e80a63
neighbor.after(aTab);
} else {
this.tabContainer.insertBefore(aTab, neighbor);
@@ -5697,7 +5842,7 @@
@@ -5697,7 +5849,7 @@
}
moveTabToGroup(aTab, aGroup) {
@@ -566,7 +605,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..06a4aae50ebe8a42d08d4689d8e80a63
return;
}
if (aTab.group && aTab.group.id === aGroup.id) {
@@ -5721,6 +5866,10 @@
@@ -5721,6 +5873,10 @@
moveActionCallback();
@@ -577,7 +616,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..06a4aae50ebe8a42d08d4689d8e80a63
// Clear tabs cache after moving nodes because the order of tabs may have
// changed.
this.tabContainer._invalidateCachedTabs();
@@ -5771,7 +5920,7 @@
@@ -5771,7 +5927,7 @@
createLazyBrowser,
};
@@ -586,7 +625,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..06a4aae50ebe8a42d08d4689d8e80a63
if (aIndex < numPinned || (aTab.pinned && aIndex == numPinned)) {
params.pinned = true;
}
@@ -6513,7 +6662,7 @@
@@ -6513,7 +6669,7 @@
// preventDefault(). It will still raise the window if appropriate.
break;
}
@@ -595,7 +634,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..06a4aae50ebe8a42d08d4689d8e80a63
window.focus();
aEvent.preventDefault();
break;
@@ -7415,6 +7564,7 @@
@@ -7415,6 +7571,7 @@
aWebProgress.isTopLevel
) {
this.mTab.setAttribute("busy", "true");
@@ -603,7 +642,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..06a4aae50ebe8a42d08d4689d8e80a63
gBrowser._tabAttrModified(this.mTab, ["busy"]);
this.mTab._notselectedsinceload = !this.mTab.selected;
}
@@ -8381,7 +8531,7 @@ var TabContextMenu = {
@@ -8381,7 +8538,7 @@ var TabContextMenu = {
);
contextUnpinSelectedTabs.hidden =
!this.contextTab.pinned || !multiselectionContext;
@@ -612,7 +651,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..06a4aae50ebe8a42d08d4689d8e80a63
// Move Tab items
let contextMoveTabOptions = document.getElementById(
"context_moveTabOptions"
@@ -8414,7 +8564,7 @@ var TabContextMenu = {
@@ -8414,7 +8571,7 @@ var TabContextMenu = {
let contextMoveTabToStart = document.getElementById("context_moveToStart");
let isFirstTab =
tabsToMove[0] == visibleTabs[0] ||
@@ -621,7 +660,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..06a4aae50ebe8a42d08d4689d8e80a63
contextMoveTabToStart.disabled = isFirstTab && allSelectedTabsAdjacent;
document.getElementById("context_openTabInWindow").disabled =
@@ -8647,6 +8797,7 @@ var TabContextMenu = {
@@ -8647,6 +8804,7 @@ var TabContextMenu = {
if (this.contextTab.multiselected) {
gBrowser.removeMultiSelectedTabs();
} else {

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/tabbrowser/content/tabs.js b/browser/components/tabbrowser/content/tabs.js
index fa96568d366fd3608f9bd583fa793150bd815c8b..1c940a3b162919256ca73fa867c5c261a3395e25 100644
index fa96568d366fd3608f9bd583fa793150bd815c8b..13a870629a98304cb18dc09b5ae075d734668f2a 100644
--- a/browser/components/tabbrowser/content/tabs.js
+++ b/browser/components/tabbrowser/content/tabs.js
@@ -94,7 +94,7 @@
@@ -145,7 +145,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..1c940a3b162919256ca73fa867c5c261
}
get verticalMode() {
@@ -1537,28 +1565,40 @@
@@ -1537,29 +1565,41 @@
if (this.#allTabs) {
return this.#allTabs;
}
@@ -189,11 +189,12 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..1c940a3b162919256ca73fa867c5c261
}
get allGroups() {
- let children = Array.from(this.arrowScrollbox.children);
+ let children = ZenWorkspaces.tabboxChildren;
return children.filter(node => node.tagName == "tab-group");
let children = Array.from(this.arrowScrollbox.children);
- return children.filter(node => node.tagName == "tab-group");
+ return ZenWorkspaces.allTabGroups;
}
/**
@@ -1579,7 +1619,7 @@
*/
get visibleTabs() {

View File

@@ -0,0 +1,12 @@
diff --git a/toolkit/content/widgets/findbar.js b/toolkit/content/widgets/findbar.js
index 8ca512e0b212bb6e25ed37e7edb4f8e2587d5bb0..5abfff92b3a8df5d138082af96419668a2c8a9bb 100644
--- a/toolkit/content/widgets/findbar.js
+++ b/toolkit/content/widgets/findbar.js
@@ -1188,6 +1188,7 @@
* e.g. <command name="cmd_find" oncommand="gFindBar.onFindCommand();"/>
*/
onFindCommand() {
+ if (gBrowser?.selectedTab?.hasAttribute("zen-empty-tab")) return;
return this.startFind(this.FIND_NORMAL);
}