From b12149bafd7ed20daa757163e84381f6650e9d2e Mon Sep 17 00:00:00 2001 From: meow Date: Tue, 31 May 2022 11:58:12 +0300 Subject: [PATCH] Save time during redirection on another instance --- assets/js/player.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/assets/js/player.js b/assets/js/player.js index ff9302b73..4244f2e2d 100644 --- a/assets/js/player.js +++ b/assets/js/player.js @@ -704,3 +704,9 @@ if (location.pathname.startsWith('/embed/')) { var cb = player.getChild('ControlBar'); 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); +});