mirror of
https://github.com/SoPat712/Speeder.git
synced 2026-10-08 03:03:14 -04:00
fix(controller): reset shortcut target after navigation
This commit is contained in:
2 files changed
+48
-1
No files matched your search
@@ -4557,7 +4557,16 @@ function attachMediaDetectionListeners(root) {
|
||||
}
|
||||
|
||||
function scheduleNavigationRescan() {
|
||||
window.vscLastObservedHref = location.href;
|
||||
var nextHref = location.href;
|
||||
if (window.vscLastObservedHref !== nextHref) {
|
||||
// Pointer and controller interaction state belongs to the previous route.
|
||||
// YouTube keeps hover-preview and Shorts players connected across SPA
|
||||
// navigations, so retaining either target can send shortcuts to an
|
||||
// off-screen/stale player even though the new watch controller works.
|
||||
tc.lastPointerPosition = null;
|
||||
tc.lastInteractedMedia = null;
|
||||
}
|
||||
window.vscLastObservedHref = nextHref;
|
||||
clearTimeout(window.vscNavigationRescanTimer);
|
||||
window.vscNavigationRescanTimer = setTimeout(function() {
|
||||
initializeWhenReady(document, true);
|
||||
|
||||
Reference in new issue
Block a user