diff options
| author | meow <woem> | 2022-05-31 12:18:42 +0300 |
|---|---|---|
| committer | meow <woem> | 2022-05-31 12:18:42 +0300 |
| commit | f2f3f045e5482618c6dcc18c410556a3b4045f99 (patch) | |
| tree | e26551ea2d060b5878435b5f442e4323cb119dec /assets/js/player.js | |
| parent | b12149bafd7ed20daa757163e84381f6650e9d2e (diff) | |
| download | invidious-f2f3f045e5482618c6dcc18c410556a3b4045f99.tar.gz invidious-f2f3f045e5482618c6dcc18c410556a3b4045f99.tar.bz2 invidious-f2f3f045e5482618c6dcc18c410556a3b4045f99.zip | |
fix time adding dirung redirection
Diffstat (limited to 'assets/js/player.js')
| -rw-r--r-- | assets/js/player.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/assets/js/player.js b/assets/js/player.js index 4244f2e2..48533b3e 100644 --- a/assets/js/player.js +++ b/assets/js/player.js @@ -705,8 +705,10 @@ if (location.pathname.startsWith('/embed/')) { cb.addChild(watch_on_invidious_button); } -// Save time during redirection on another instance -const changeInstanceLink = document.querySelector('#watch-on-another-invidious-instance > a'); -if (changeInstanceLink) changeInstanceLink.addEventListener('click', function () { - changeInstanceLink.href = addCurrentTimeToURL(changeInstanceLink.href); +addEventListener('DOMContentLoaded', function () { + // Save time during redirection on another instance + const changeInstanceLink = document.querySelector('#watch-on-another-invidious-instance > a'); + if (changeInstanceLink) changeInstanceLink.addEventListener('click', function () { + changeInstanceLink.href = addCurrentTimeToURL(changeInstanceLink.href); + }); }); |
