aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAjay Ramachandran <[email protected]>2021-03-26 18:36:29 -0400
committerGitHub <[email protected]>2021-03-26 18:36:29 -0400
commit8dfa386cdb3cf7bad8817c5ecd26f81d54e26a8a (patch)
treee9000d84e7fae8c8eb0a109cb502b5f5acbc51c9
parent4469eada54899594694c1b45f51540641a3b4706 (diff)
parent719010db976334cdefad436f36e6fc651895c901 (diff)
downloadSponsorBlock-8dfa386cdb3cf7bad8817c5ecd26f81d54e26a8a.tar.gz
SponsorBlock-8dfa386cdb3cf7bad8817c5ecd26f81d54e26a8a.zip
Merge pull request #701 from manualmanul/fix-youtube-tv
Partially fix YouTube TV support
-rw-r--r--src/content.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/content.ts b/src/content.ts
index ba1bd757..33842dd3 100644
--- a/src/content.ts
+++ b/src/content.ts
@@ -1530,8 +1530,9 @@ 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)) {
+ if (videoRoot && !videoRootsWithEventListeners.includes(videoRoot)) {
videoRoot.addEventListener("keydown", hotkeyListener);
videoRootsWithEventListeners.push(videoRoot);
return true;