From 60f9274438a4bfc0aef0f7a1d6d0d9cf53822b0d Mon Sep 17 00:00:00 2001 From: Michael C Date: Thu, 6 Jul 2023 18:02:13 -0400 Subject: [PATCH] add selectors for YT kids --- src/content.ts | 2 +- src/js-components/previewBar.ts | 3 ++- src/utils.ts | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/content.ts b/src/content.ts index 2f15496a..0a3e04cb 100644 --- a/src/content.ts +++ b/src/content.ts @@ -521,7 +521,7 @@ function createPreviewBar(): void { selector: ".vjs-progress-holder", isVisibleCheck: false }, { - // For Youtube Music + // For Youtube Music and YTKids // there are two sliders, one for volume and one for progress - both called #progressContainer selector: "#progress-bar>#sliderContainer>div>#sliderBar>#progressContainer", }, { diff --git a/src/js-components/previewBar.ts b/src/js-components/previewBar.ts index 80d61c8f..944066c7 100644 --- a/src/js-components/previewBar.ts +++ b/src/js-components/previewBar.ts @@ -97,7 +97,8 @@ class PreviewBar { this.chapterTooltip = document.createElement("div"); this.chapterTooltip.className = "ytp-tooltip-title sponsorCategoryTooltip"; - const tooltipTextWrapper = document.querySelector(".ytp-tooltip-text-wrapper"); + // global chaper tooltip or duration tooltip + const tooltipTextWrapper = document.querySelector(".ytp-tooltip-text-wrapper") ?? document.querySelector("#progress-bar-container.ytk-player > #hover-time-info"); const originalTooltip = tooltipTextWrapper.querySelector(".ytp-tooltip-title:not(.sponsorCategoryTooltip)") as HTMLElement; if (!tooltipTextWrapper || !tooltipTextWrapper.parentElement) return; diff --git a/src/utils.ts b/src/utils.ts index cbe4e589..e55c4e44 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -299,7 +299,8 @@ export default class Utils { "#main-panel.ytmusic-player-page", // YouTube music "#player-container .video-js", // Invidious ".main-video-section > .video-container", // Cloudtube - ".shaka-video-container" // Piped + ".shaka-video-container", // Piped + "#player-container.ytk-player", // YT Kids ]; let referenceNode = findValidElementFromSelector(selectors)