aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMichael C <[email protected]>2023-07-06 18:02:13 -0400
committerMichael C <[email protected]>2023-07-06 18:02:13 -0400
commit60f9274438a4bfc0aef0f7a1d6d0d9cf53822b0d (patch)
tree7954900a32ad7a0c42c531334246aabfa4c8dc44
parent87bf472ee459d117c50e1447430ac7601eda2beb (diff)
downloadSponsorBlock-60f9274438a4bfc0aef0f7a1d6d0d9cf53822b0d.tar.gz
SponsorBlock-60f9274438a4bfc0aef0f7a1d6d0d9cf53822b0d.zip
add selectors for YT kids
-rw-r--r--src/content.ts2
-rw-r--r--src/js-components/previewBar.ts3
-rw-r--r--src/utils.ts3
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)