From dabc63af735580b5656fcab92fb365906f7a3728 Mon Sep 17 00:00:00 2001 From: Ajay Date: Fri, 7 Oct 2022 12:02:14 -0400 Subject: Deletew all custom chapter bars we don't know about when clearing preview bar --- src/js-components/previewBar.ts | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/js-components/previewBar.ts b/src/js-components/previewBar.ts index 1de04412..24251c09 100644 --- a/src/js-components/previewBar.ts +++ b/src/js-components/previewBar.ts @@ -218,6 +218,12 @@ class PreviewBar { if (this.customChaptersBar) this.customChaptersBar.style.display = "none"; this.originalChapterBar?.style?.removeProperty("display"); this.chapterVote?.setVisibility(false); + + document.querySelectorAll(`.sponsorBlockChapterBar`).forEach((e) => { + if (e !== this.customChaptersBar) { + e.remove(); + } + }); } set(segments: PreviewBarSegment[], videoDuration: number): void { -- cgit v1.2.3