From cb24052969f5d73ae94e3a45994402194f84e7d5 Mon Sep 17 00:00:00 2001 From: mauro-balades Date: Thu, 26 Sep 2024 18:58:04 +0200 Subject: [PATCH] Do not show default container context menu if disabled --- src/ZenWorkspaces.mjs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/ZenWorkspaces.mjs b/src/ZenWorkspaces.mjs index c7c07ae..f154c7f 100644 --- a/src/ZenWorkspaces.mjs +++ b/src/ZenWorkspaces.mjs @@ -251,6 +251,11 @@ var ZenWorkspaces = { return workspace.name[0].toUpperCase(); }, + get shouldShowContainers() { + return Services.prefs.getBoolPref('privacy.userContext.ui.enabled') && + ContextualIdentityService.getPublicIdentities().length > 0; + }, + async _propagateWorkspaceData({ ignoreStrip = false } = {}) { @@ -721,6 +726,12 @@ var ZenWorkspaces = { } else { openMenuItem.removeAttribute('disabled'); } + const openInContainerMenuItem = document.getElementById('context_zenWorkspacesOpenInContainerTab'); + if (this.shouldShowContainers) { + openInContainerMenuItem.removeAttribute('hidden'); + } else { + openInContainerMenuItem.setAttribute('hidden', 'true'); + } }, async contextChangeContainerTab(event) {