diff options
| -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) } |
