mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-08 20:47:11 +03:00
Fix chapter box title selector
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user