From 54b4681fc3972317dc35b5e75aa99f35a90dd96c Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Wed, 3 Feb 2021 18:28:50 -0500 Subject: [PATCH] Fix invidious support Fixes https://github.com/ajayyy/SponsorBlock/issues/636 --- src/content.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/content.ts b/src/content.ts index fcfe832f..e6e87704 100644 --- a/src/content.ts +++ b/src/content.ts @@ -1528,7 +1528,8 @@ function getSegmentsMessage(sponsorTimes: SponsorTime[]): string { } function addHotkeyListener(): boolean { - const videoRoot = document.getElementById("movie_player") as HTMLDivElement; + let videoRoot = document.getElementById("movie_player") as HTMLDivElement; + if (onInvidious) videoRoot = document.getElementById("player-container") as HTMLDivElement; if (!videoRootsWithEventListeners.includes(videoRoot)) { videoRoot.addEventListener("keydown", hotkeyListener);