add selectors for YT kids

This commit is contained in:
Michael C 2023-07-06 18:02:13 -04:00
parent 87bf472ee4
commit 60f9274438
No known key found for this signature in database
GPG key ID: FFB04FB3B878B7B4
3 changed files with 5 additions and 3 deletions

View file

@ -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",
}, {

View file

@ -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;

View file

@ -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)