diff options
| author | Tim Keller <tjk@tjkeller.xyz> | 2026-05-14 21:32:43 -0500 |
|---|---|---|
| committer | Tim Keller <tjk@tjkeller.xyz> | 2026-05-14 21:32:43 -0500 |
| commit | 3bfeed5a50cd1bb405cbe145611410fa4f628413 (patch) | |
| tree | a8b0bb6327f192bfcc8ebc3eada7a103e75aa30d | |
| parent | 372756dcfaf98e2e1995c69d563695805b24e933 (diff) | |
| download | embedtube-master.tar.xz embedtube-master.zip | |
| -rw-r--r-- | static/index.js | 11 |
1 files 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) |
