Skip to content

Commit

Permalink
[#74] Always mark current page as handled
Browse files Browse the repository at this point in the history
This prevents reopening the tab when the handler is run again for some
reason, e.g. because the options changed
  • Loading branch information
cpiber committed Jan 17, 2025
1 parent de20fe4 commit e27689e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/scripts/content/youtube/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit e27689e

Please sign in to comment.