aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/utils/pageUtils.ts
diff options
context:
space:
mode:
authorAjay <[email protected]>2024-09-23 03:58:11 -0400
committerAjay <[email protected]>2024-09-23 03:58:11 -0400
commit36549e7898fcf32dba90c5225d3c0dfa736134e9 (patch)
tree002c772c22e7886f65968b40350e5c209bd38737 /src/utils/pageUtils.ts
parent0d2d5f2eb0e55b0cc3559b846200d209c5d8a3cd (diff)
downloadSponsorBlock-36549e7898fcf32dba90c5225d3c0dfa736134e9.tar.gz
SponsorBlock-36549e7898fcf32dba90c5225d3c0dfa736134e9.zip
Fix chapter box title selector
Diffstat (limited to 'src/utils/pageUtils.ts')
-rw-r--r--src/utils/pageUtils.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/utils/pageUtils.ts b/src/utils/pageUtils.ts
index f38ad503..aec411c4 100644
--- a/src/utils/pageUtils.ts
+++ b/src/utils/pageUtils.ts
@@ -55,7 +55,7 @@ export function getHashParams(): Record<string, unknown> {
export function getExistingChapters(currentVideoID: VideoID, duration: number): SponsorTime[] {
const chaptersBox = document.querySelector("ytd-macro-markers-list-renderer");
- const title = document.querySelector("[target-id=engagement-panel-macro-markers-auto-chapters] #title-text");
+ const title = chaptersBox?.closest("ytd-engagement-panel-section-list-renderer")?.querySelector("#title-text.ytd-engagement-panel-title-header-renderer");
if (title?.textContent?.includes("Key moment")) return [];
const chapters: SponsorTime[] = [];
@@ -92,6 +92,8 @@ export function getExistingChapters(currentVideoID: VideoID, duration: number):
}
}
+ console.log(chapters)
+
return chapters;
}