From e27689e30facab99b8d04ac3f10b92516ce3cc5d Mon Sep 17 00:00:00 2001 From: Constantin Piber Date: Fri, 17 Jan 2025 12:00:53 +0100 Subject: [PATCH] [#74] Always mark current page as handled This prevents reopening the tab when the handler is run again for some reason, e.g. because the options changed --- src/scripts/content/youtube/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/scripts/content/youtube/index.ts b/src/scripts/content/youtube/index.ts index d8e8498..56866f0 100644 --- a/src/scripts/content/youtube/index.ts +++ b/src/scripts/content/youtube/index.ts @@ -159,9 +159,10 @@ const run = debounce(async ({ vidID, videoTitle, channelID, channelNice }: { vid if (vid.is === 'channel' || !doOpenTab) return; yield; + /* eslint-disable-next-line camelcase */ + window.history.replaceState({ ...window.history.state, _enhancer_checked: true }, ''); + if (replaceTab) { - /* eslint-disable-next-line camelcase */ - window.history.replaceState({ ...window.history.state, _enhancer_checked: true }, ''); window.location.href = vid.link; return; }