From 3bfeed5a50cd1bb405cbe145611410fa4f628413 Mon Sep 17 00:00:00 2001 From: Tim Keller Date: Thu, 14 May 2026 21:32:43 -0500 Subject: fix clicking timestamp from comments --- static/index.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/static/index.js b/static/index.js index ef3a097..c577050 100644 --- a/static/index.js +++ b/static/index.js @@ -178,8 +178,15 @@ function timestampLinkClick(e) { if (!t) return player.seekTo(t) - window.history.replaceState({}, "", url) /* reflect time in url bar */ - window.scrollTo(0, 0) /* return to page top */ + + // change url to match window in case clicking on youtube.com link + url.protocol = window.location.protocol + url.hostname = window.location.hostname + url.port = window.location.port + + // reflect url and scroll to top of page + window.history.replaceState({}, "", url) + window.scrollTo(0, 0) } document.addEventListener("click", timestampLinkClick) -- cgit v1.2.3