aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAjay <[email protected]>2022-10-30 20:36:05 -0400
committerAjay <[email protected]>2022-10-30 20:36:05 -0400
commit6db498ccb1a60db0a16c8cf26b92b682bd047755 (patch)
tree552abefc76d65360b5683739d741c529b03cd368
parentef8c5f58c55ca25f2966cfbe5c73014d4db89964 (diff)
downloadSponsorBlock-6db498ccb1a60db0a16c8cf26b92b682bd047755.tar.gz
SponsorBlock-6db498ccb1a60db0a16c8cf26b92b682bd047755.zip
Fix key moments check not working when multiple videos present
-rw-r--r--src/utils/pageUtils.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/utils/pageUtils.ts b/src/utils/pageUtils.ts
index db18aae7..94c58bfc 100644
--- a/src/utils/pageUtils.ts
+++ b/src/utils/pageUtils.ts
@@ -71,7 +71,8 @@ export function getExistingChapters(currentVideoID: VideoID, duration: number):
const chapters: SponsorTime[] = [];
// .ytp-timed-markers-container indicates that key-moments are present, which should not be divided
- if (chaptersBox && !(document.querySelector(".ytp-timed-markers-container")?.childElementCount > 0)) {
+ if (chaptersBox && !(getControls()?.parentElement?.parentElement
+ ?.querySelector(".ytp-timed-markers-container")?.childElementCount > 0)) {
let lastSegment: SponsorTime = null;
const links = chaptersBox.querySelectorAll("ytd-macro-markers-list-item-renderer > a");
for (const link of links) {