gh-13364: Fixed split out context menu showing wrong label (gh-13365)

This commit is contained in:
mr. m
2026-04-23 10:25:27 +02:00
committed by GitHub
parent 26c907bb39
commit 05af15d70a
4 changed files with 21 additions and 13 deletions

View File

@@ -22,6 +22,7 @@
"chrome://browser/content/zen-components/ZenFolders.mjs",
"chrome://browser/content/zen-components/ZenEmojiPicker.mjs",
"chrome://browser/content/zen-components/ZenLiveFoldersUI.mjs",
"chrome://browser/content/zen-components/ZenDownloadAnimation.mjs",
];
for (let script of scripts) {
@@ -30,7 +31,6 @@
let customZenElements = [
["zen-folder", "chrome://browser/content/zen-components/ZenFolder.mjs"],
["zen-download-animation", "chrome://browser/content/zen-components/ZenDownloadAnimation.mjs"],
["zen-workspace-creation", "resource:///modules/zen/ZenSpaceCreation.mjs"],
["zen-workspace", "resource:///modules/zen/ZenSpace.mjs"],
["zen-workspace-icons", "resource:///modules/zen/ZenSpaceIcons.mjs"]
@@ -43,12 +43,12 @@
// used before DOMContentLoaded it will be imported and upgraded when
// registering the customElements.setElementCreationCallback().
for (let [tag, script] of customZenElements) {
customElements.setElementCreationCallback(
tag,
function customElementCreationCallback() {
ChromeUtils.importESModule(script, { global: "current" });
}
);
customElements.setElementCreationCallback(
tag,
function customElementCreationCallback() {
ChromeUtils.importESModule(script, { global: "current" });
}
);
}
},
{ once: true }

View File

@@ -1166,7 +1166,10 @@ class nsZenViewSplitter extends nsZenDOMOperatedFeature {
insetUpdateContextMenuItems() {
const contentAreaContextMenu = document.getElementById("tabContextMenu");
contentAreaContextMenu.addEventListener("popupshowing", () => {
let contextTab = TabContextMenu.contextTab || gBrowser.selectedTab;
let contextTab = TabContextMenu.contextTab;
if (!contextTab) {
return;
}
let selectedTabs = contextTab.multiselected
? gBrowser.selectedTabs
: [contextTab];
@@ -1249,6 +1252,11 @@ class nsZenViewSplitter extends nsZenDOMOperatedFeature {
let currentTab = TabContextMenu.contextTab || gBrowser.selectedTab;
if (currentTab.multiselected) {
tabs = gBrowser.selectedTabs;
} else if (!currentTab.selected) {
tabs = [
currentTab,
...gBrowser.selectedTabs.filter(t => t !== currentTab),
];
} else {
tabs = [currentTab];
}