mirror of
https://github.com/zen-browser/desktop.git
synced 2025-09-05 19:08:18 +00:00
Merge branch 'dev' of https://github.com/zen-browser/desktop into dev
This commit is contained in:
@@ -289,8 +289,10 @@
|
||||
}
|
||||
}
|
||||
gBrowser.tabContainer._invalidateCachedTabs();
|
||||
|
||||
newTab.initialize();
|
||||
if (!ZenWorkspaces.essentialShouldShowTab(newTab)) {
|
||||
gBrowser.hideTab(newTab, undefined, true);
|
||||
}
|
||||
}
|
||||
|
||||
gBrowser._updateTabBarForPinnedTabs();
|
||||
|
@@ -1666,6 +1666,21 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
return prevTabUsed;
|
||||
}
|
||||
|
||||
// Only use it in gZenPinnedTabsManager, when initializing essential tabs
|
||||
essentialShouldShowTab(tab) {
|
||||
if (tab.getAttribute('zen-essential') !== 'true') {
|
||||
return true;
|
||||
}
|
||||
const workspaces = this._workspaceCache;
|
||||
if (!workspaces) {
|
||||
return true;
|
||||
}
|
||||
const containerId = (
|
||||
workspaces.workspaces.find((workspace) => workspace.uuid === this.activeWorkspace) || {}
|
||||
)?.containerTabId?.toString();
|
||||
return this._shouldShowTab(tab, this.activeWorkspace, containerId, workspaces);
|
||||
}
|
||||
|
||||
_shouldShowTab(tab, workspaceUuid, containerId, workspaces) {
|
||||
const isEssential = tab.getAttribute('zen-essential') === 'true';
|
||||
const tabWorkspaceId = tab.getAttribute('zen-workspace-id');
|
||||
|
Reference in New Issue
Block a user