From de1d6bd76ae5e11a71ae3dfe1ac71daa38051a68 Mon Sep 17 00:00:00 2001 From: tech234a <46801700+tech234a@users.noreply.github.com> Date: Sun, 12 Jan 2025 23:01:33 -0500 Subject: [PATCH 1/3] Implement support for YouTube TV (tv.youtube.com) --- maze-utils | 2 +- public/_locales | 2 +- public/content.css | 24 +++++ src/components/ChapterVoteComponent.tsx | 4 +- src/content.ts | 22 ++++- src/js-components/previewBar.ts | 108 +++++++++++++++++++--- src/js-components/skipButtonControlBar.ts | 13 ++- src/render/ChapterVote.tsx | 4 + src/utils.ts | 1 + src/utils/pageUtils.ts | 4 +- test/previewBar.test.ts | 2 +- 11 files changed, 160 insertions(+), 26 deletions(-) diff --git a/maze-utils b/maze-utils index dc162b4e7d..2b7966b4d7 160000 --- a/maze-utils +++ b/maze-utils @@ -1 +1 @@ -Subproject commit dc162b4e7d26b33c31392ba8ba830976a2d97062 +Subproject commit 2b7966b4d72d5f1c8e9859e5505ebe4179ef27f2 diff --git a/public/_locales b/public/_locales index 1853c78fc2..5ca124d121 160000 --- a/public/_locales +++ b/public/_locales @@ -1 +1 @@ -Subproject commit 1853c78fc2f7206d6041d65dee598b8c68191b48 +Subproject commit 5ca124d1217f93b8d2100ca088bf718cf19ee60d diff --git a/public/content.css b/public/content.css index f21500eefd..3a0f32ce51 100644 --- a/public/content.css +++ b/public/content.css @@ -31,6 +31,15 @@ transition: transform .1s cubic-bezier(0,0,0.2,1); } +/* Prevent bar from covering highlights on YTTV */ +#previewbar.sponsorblock-yttv-container { + z-index: unset; +} + +ytu-time-bar.ytu-storyboard { + text-align: center; +} + /* May 2024 hover preview */ .YtPlayerProgressBarProgressBar #previewbar { transform: none; @@ -67,6 +76,11 @@ div:hover > #previewbar.sbNotInvidious { min-width: 1px; } +.previewbar-yttv { + height: 10px; + top: 14px; +} + .previewbar.requiredSegment { transform: scaleY(3); } @@ -184,6 +198,16 @@ div:hover > .sponsorBlockChapterBar { padding-right: 3.6px; } +.sbButtonYTTV { + padding-left: 5px !important; +} + +/* YTTV only */ +.ytu-player-controls > .skipButtonControlBarContainer > div { + padding-left: 5px; + align-content: center; +} + .autoHiding { overflow: visible !important; } diff --git a/src/components/ChapterVoteComponent.tsx b/src/components/ChapterVoteComponent.tsx index 677a966d17..eaafeaa1b4 100644 --- a/src/components/ChapterVoteComponent.tsx +++ b/src/components/ChapterVoteComponent.tsx @@ -44,7 +44,7 @@ class ChapterVoteComponent extends React.Component {/* Upvote Button */}