From 067c55738072c306d6f0d0d018d15b03ba276538 Mon Sep 17 00:00:00 2001 From: Rain Date: Sat, 2 Sep 2023 19:47:35 +0000 Subject: [PATCH] Fix muted tabs not clearing on tab close (#9) * Fix muted tabs not clearing on tab close * fix format --- jump_to_audio_tab.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/jump_to_audio_tab.js b/jump_to_audio_tab.js index f6fb217..8749ea3 100644 --- a/jump_to_audio_tab.js +++ b/jump_to_audio_tab.js @@ -76,7 +76,7 @@ browser.contextMenus.onClicked.addListener((info, tab) => { promises.push( browser.tabs.update(currentTab.id, { active: false, - }) + }), ); } @@ -226,7 +226,7 @@ function checkContextCompat() { id: `${EXT_TAB_ID}placeholder`, title: "Test menu support", contexts: [context], - }) + }), ); CONTEXTS.push(context); } catch (error) { @@ -313,7 +313,13 @@ browser.tabs.onRemoved.addListener((tabId, removeInfo) => { AUDIBLE_TABS = AUDIBLE_TABS.filter((x) => { return x.id !== tabId; }); + + MUTED_TABS = MUTED_TABS.filter((x) => { + return x.id !== tabId; + }); + RECENT_TAB_IDS.delete(tabId); + populateMenu(); });