From 38e09d84fdfb262e56edd8e7b1bfbc52b7f28d42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristijan=20Ribari=C4=87?= Date: Tue, 19 Nov 2024 22:06:23 +0100 Subject: [PATCH] (feat) Hide pinned tabs not in active workspace When a new pinned tab is opened and it does not belong to the currently active workspace and is not marked as essential, it will now be hidden. This prevents pinned tabs from cluttering the tab bar when switching between workspaces. The global variable for the pinned tab manager has also been renamed from `gZenPinnedTabManager` to `_initializePinnedTabs`. --- src/browser/base/zen-components/ZenPinnedTabManager.mjs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/browser/base/zen-components/ZenPinnedTabManager.mjs b/src/browser/base/zen-components/ZenPinnedTabManager.mjs index a0bfae125..43c921ec4 100644 --- a/src/browser/base/zen-components/ZenPinnedTabManager.mjs +++ b/src/browser/base/zen-components/ZenPinnedTabManager.mjs @@ -196,6 +196,10 @@ gBrowser.pinTab(newTab); + if(newTab.getAttribute("zen-workspace-id") !== ZenWorkspaces.activeWorkspace && newTab.getAttribute("zen-essential") !== "true") { + gBrowser.hideTab(newTab, undefined, true); + } + newTab.initialize(); }