diff options
| author | Ewy~ <ewy0@protonmail.com> | 2026-01-04 02:02:48 +0100 |
|---|---|---|
| committer | Ewy~ <ewy0@protonmail.com> | 2026-01-04 02:02:48 +0100 |
| commit | dadb5a1350724a517feb002336c74efb28bfd600 (patch) | |
| tree | 21e76e73724103ad4d53487ce3be70adf2bf4ab7 | |
| parent | 8175ef1cd145d68b987efece442ae244bef892e4 (diff) | |
| -rw-r--r-- | youtube-auto-timestamper.user.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/youtube-auto-timestamper.user.js b/youtube-auto-timestamper.user.js index ec384cb..b2efcef 100644 --- a/youtube-auto-timestamper.user.js +++ b/youtube-auto-timestamper.user.js @@ -17,6 +17,8 @@ const timeDelay = 0; const timeRegex = /(([&?])t=[0-9]+)/ +let lastTime = undefined; + const tick = () => { const ytplayer = document.getElementById("movie_player"); if (!ytplayer) { @@ -40,6 +42,12 @@ const tick = () => { } else { currentUrl = currentUrl + "&t=" + time } + + if (time == lastTime) { + return + } + + lastTime = time history.replaceState(currentUrl, "", currentUrl) } |
