diff --git a/src/content.ts b/src/content.ts index 855255d7..b8652aaa 100644 --- a/src/content.ts +++ b/src/content.ts @@ -431,20 +431,20 @@ function createPreviewBar(): void { const progressElementOptions = [{ // For Desktop Bilibili selector: ".bpx-player-progress-schedule-wrap", + shadowSelector: ".bpx-player-shadow-progress-area", isVisibleCheck: true - } - ]; + }]; for (const option of progressElementOptions) { const allElements = document.querySelectorAll(option.selector) as NodeListOf; - const el = option.isVisibleCheck ? findValidElement(allElements) : allElements[0]; + const parent = option.isVisibleCheck ? findValidElement(allElements) : allElements[0]; + const allshadowSelectorElements = document.querySelectorAll(option.shadowSelector) as NodeListOf; + const shadowParent = allshadowSelectorElements[0]; - if (el) { + if (parent) { const chapterVote = new ChapterVote(voteAsync); - previewBar = new PreviewBar(el, chapterVote); - + previewBar = new PreviewBar(parent, shadowParent, chapterVote); updatePreviewBar(); - break; } } diff --git a/src/js-components/previewBar.ts b/src/js-components/previewBar.ts index c5dff29a..82563368 100644 --- a/src/js-components/previewBar.ts +++ b/src/js-components/previewBar.ts @@ -25,7 +25,10 @@ export interface PreviewBarSegment { } class PreviewBar { + // main progress bar container: HTMLUListElement; + // small progress bar on the bottom of