mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-09 21:17:20 +03:00
fix exception when on youtube.com/tv
This commit is contained in:
@@ -1530,6 +1530,7 @@ function getSegmentsMessage(sponsorTimes: SponsorTime[]): string {
|
||||
function addHotkeyListener(): boolean {
|
||||
let videoRoot = document.getElementById("movie_player") as HTMLDivElement;
|
||||
if (onInvidious) videoRoot = (document.getElementById("player-container") ?? document.getElementById("player")) as HTMLDivElement;
|
||||
if (video.baseURI.startsWith("https://www.youtube.com/tv#/")) videoRoot = document.querySelector("ytlr-watch-page") as HTMLDivElement;
|
||||
|
||||
if (!videoRootsWithEventListeners.includes(videoRoot)) {
|
||||
videoRoot.addEventListener("keydown", hotkeyListener);
|
||||
|
||||
Reference in New Issue
Block a user