Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/zen/common/modules/ZenVerticalTabsManager.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ window.gZenVerticalTabsManager = {
<menuseparator/>
`);
const menu = fragment.firstElementChild;
const separator = menu.nextElementSibling;
menu.addEventListener("popupshowing", event =>
gZenWorkspaces.updateWorkspaceActionsMenuContainer(event)
);
Expand All @@ -98,7 +99,9 @@ window.gZenVerticalTabsManager = {
const contextMenu = document.getElementById("toolbar-context-menu");
contextMenu.addEventListener("popupshowing", event => {
if (event.target === contextMenu) {
menu.hidden = !gZenWorkspaces.shouldShowContainers;
const hidden = !gZenWorkspaces.shouldShowContainers;
menu.hidden = hidden;
separator.hidden = hidden;
}
});
document
Expand Down
1 change: 1 addition & 0 deletions src/zen/spaces/ZenSpaceManager.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1523,6 +1523,7 @@ class nsZenWorkspaces {

get shouldShowContainers() {
return (
!this.isPrivateWindow &&
Services.prefs.getBoolPref("privacy.userContext.ui.enabled") &&
!!ContextualIdentityService.getPublicIdentities().length
);
Expand Down
18 changes: 18 additions & 0 deletions src/zen/tests/spaces/browser_private_mode.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,24 @@ add_task(async function test_Private_Mode() {
"Private window should start with a zen empty tab"
);

Assert.ok(
!privateWindow.gZenWorkspaces.shouldShowContainers,
"Containers/profiles should not be shown in private windows"
);

const popup = privateWindow.document.getElementById("zenWorkspaceMoreActions");
privateWindow.gZenWorkspaces.updateWorkspaceActionsMenu({
target: popup,
});

const openInContainerMenuItem = privateWindow.document.getElementById(
"context_zenWorkspacesOpenInContainerTab"
);
Assert.ok(
openInContainerMenuItem.hidden,
"Set Profile menu should be hidden in private window"
);

await BrowserTestUtils.closeWindow(privateWindow);
await SpecialPowers.popPrefEnv();
});
Loading