From 0536c9b2647f5280d1858bebad39c056a79152aa Mon Sep 17 00:00:00 2001 From: ImprovedTube Date: Tue, 7 Nov 2023 01:42:53 +0100 Subject: [PATCH] Please Fix: player.parentNode doesnt exist on youtube.com/shorts --- js&css/web-accessible/www.youtube.com/shortcuts.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js&css/web-accessible/www.youtube.com/shortcuts.js b/js&css/web-accessible/www.youtube.com/shortcuts.js index 610bc3246..1d14d431f 100644 --- a/js&css/web-accessible/www.youtube.com/shortcuts.js +++ b/js&css/web-accessible/www.youtube.com/shortcuts.js @@ -133,12 +133,13 @@ ImprovedTube.shortcuts = function () { }); document.addEventListener('improvedtube-player-loaded', function () { - ImprovedTube.elements.player.parentNode.addEventListener('mouseover', function () { + //Please Fix: November2023: this parentNode doesnt exist on youtube.com/shorts + ImprovedTube.elements.player.parentNode?.addEventListener('mouseover', function () { mouse.player = true; mouse.wheel = 0; }, true); - ImprovedTube.elements.player.parentNode.addEventListener('mouseout', function () { + ImprovedTube.elements.player.parentNode?.addEventListener('mouseout', function () { mouse.player = false; mouse.wheel = 0; }, true);