From ab55e113cd6bf176fb0c0374f6caea40cc8caf93 Mon Sep 17 00:00:00 2001 From: "YUKI \"Piro\" Hiroshi" Date: Thu, 9 Nov 2023 18:24:40 +0900 Subject: [PATCH] Don't show tree specific sub menu for multiselection --- background/context-menu.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/background/context-menu.js b/background/context-menu.js index 44906d2..019caa6 100644 --- a/background/context-menu.js +++ b/background/context-menu.js @@ -347,13 +347,14 @@ async function onShown(info, tab) { const context = new Context({ tab }); await context.resolve(); - const chooseFromMenu = (context.isTreeParent ? configs.modeForNoSelectionTree : configs.modeForNoSelection) == Constants.kCOPY_CHOOSE_FROM_MENU; + const multiselected = context.multiselectedTabs.length > 1; + const chooseFromMenu = (!multiselected && context.isTreeParent ? configs.modeForNoSelectionTree : configs.modeForNoSelection) == Constants.kCOPY_CHOOSE_FROM_MENU; log('onShown ', { chooseFromMenu, isTreeParent: context.isTreeParent, - multiselected: context.multiselectedTabs.length > 1, + multiselected, }); - const titleKey = (context.multiselectedTabs.length > 1 || chooseFromMenu) ? + const titleKey = (multiselected || chooseFromMenu) ? 'context_copyTabs_label' : context.shouldCopyAll ? 'context_copyAllTabs_label' : context.shouldCopyOnlyDescendants ? 'context_copyTreeDescendants_label' :