Do not show default container context menu if disabled

This commit is contained in:
mauro-balades 2024-09-26 18:58:04 +02:00
parent 9cce473af8
commit cb24052969

View file

@ -251,6 +251,11 @@ var ZenWorkspaces = {
return workspace.name[0].toUpperCase(); return workspace.name[0].toUpperCase();
}, },
get shouldShowContainers() {
return Services.prefs.getBoolPref('privacy.userContext.ui.enabled') &&
ContextualIdentityService.getPublicIdentities().length > 0;
},
async _propagateWorkspaceData({ async _propagateWorkspaceData({
ignoreStrip = false ignoreStrip = false
} = {}) { } = {}) {
@ -721,6 +726,12 @@ var ZenWorkspaces = {
} else { } else {
openMenuItem.removeAttribute('disabled'); openMenuItem.removeAttribute('disabled');
} }
const openInContainerMenuItem = document.getElementById('context_zenWorkspacesOpenInContainerTab');
if (this.shouldShowContainers) {
openInContainerMenuItem.removeAttribute('hidden');
} else {
openInContainerMenuItem.setAttribute('hidden', 'true');
}
}, },
async contextChangeContainerTab(event) { async contextChangeContainerTab(event) {