From 7609de9c6ae8467328784830167600fccbe58121 Mon Sep 17 00:00:00 2001 From: "YUKI \"Piro\" Hiroshi" Date: Fri, 29 Nov 2024 12:02:11 +0900 Subject: [PATCH] Don't show already hidden tab preview tooltip on updated --- webextensions/resources/tab-preview-frame.js | 4 ++-- webextensions/sidebar/tab-preview-tooltip.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/webextensions/resources/tab-preview-frame.js b/webextensions/resources/tab-preview-frame.js index 3dddaf2c9..992e540b7 100644 --- a/webextensions/resources/tab-preview-frame.js +++ b/webextensions/resources/tab-preview-frame.js @@ -180,8 +180,8 @@ try{ switch (message?.type) { case 'treestyletab:update-tab-preview': if (!panel || - (message.tabId && - panel.dataset.tabId != message.tabId)) { + panel.dataset.tabId != message.tabId || + panel.classList.contains('hidden')) { return; } case 'treestyletab:show-tab-preview': diff --git a/webextensions/sidebar/tab-preview-tooltip.js b/webextensions/sidebar/tab-preview-tooltip.js index 94d5bc1f5..a355366b8 100644 --- a/webextensions/sidebar/tab-preview-tooltip.js +++ b/webextensions/sidebar/tab-preview-tooltip.js @@ -243,8 +243,8 @@ async function sendTabPreviewMessage(tabId, message, deferredReturnedValueResolv return promisedReturnedValue; } - if (!returnValue) { - // Failed to show in-content tab preview, so + if (typeof returnValue != 'boolean') { + // Failed to send message to the in-content tab preview frame, so // now we fall back to the in-sidebar tab preview. return sendInSidebarTabPreviewMessage(message); }