diff --git a/src/js-components/previewBar.ts b/src/js-components/previewBar.ts index dc7c7d0b..7d58f861 100644 --- a/src/js-components/previewBar.ts +++ b/src/js-components/previewBar.ts @@ -255,7 +255,8 @@ class PreviewBar { const newChapterBar = chapterBar.cloneNode(true) as HTMLElement; newChapterBar.classList.add("sponsorBlockChapterBar"); newChapterBar.style.removeProperty("display"); - const originalSection = newChapterBar.querySelector(".ytp-chapter-hover-container"); + const originalSections = newChapterBar.querySelectorAll(".ytp-chapter-hover-container"); + const originalSection = originalSections[0]; this.customChaptersBar = newChapterBar; this.chaptersBarSegments = segments; @@ -273,7 +274,7 @@ class PreviewBar { // Hide old bar chapterBar.style.display = "none"; - originalSection.remove(); + originalSections.forEach((section) => section.remove()); if (this.container?.parentElement === progressBar) { progressBar.insertBefore(newChapterBar, this.container.nextSibling); } else {