Skip to content

Commit e27689e

Browse files
committed
[#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
1 parent de20fe4 commit e27689e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/scripts/content/youtube/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,10 @@ const run = debounce(async ({ vidID, videoTitle, channelID, channelNice }: { vid
159159
if (vid.is === 'channel' || !doOpenTab) return;
160160
yield;
161161

162+
/* eslint-disable-next-line camelcase */
163+
window.history.replaceState({ ...window.history.state, _enhancer_checked: true }, '');
164+
162165
if (replaceTab) {
163-
/* eslint-disable-next-line camelcase */
164-
window.history.replaceState({ ...window.history.state, _enhancer_checked: true }, '');
165166
window.location.href = vid.link;
166167
return;
167168
}

0 commit comments

Comments
 (0)