diff --git a/assets/js/handlers.js b/assets/js/handlers.js index 67cd9081..d765a48f 100644 --- a/assets/js/handlers.js +++ b/assets/js/handlers.js @@ -146,4 +146,15 @@ event.preventDefault(); } }); + + // Handle the video watched state with JavaScript (if enabled) + const anchorElements = document.querySelectorAll('a[href^="/watch"]'); + + for (const anchorElement of anchorElements) { + const url = new URL(anchorElement.href); + + url.searchParams.set("mark_watched", "0"); + + anchorElement.href = url.href; + } })();