mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-11 22:17:21 +03:00
Fix preview bar on mobile
This commit is contained in:
@@ -234,14 +234,15 @@ class PreviewBar {
|
|||||||
const allProgressBars = document.querySelectorAll('.ytp-progress-bar') as NodeListOf<HTMLElement>;
|
const allProgressBars = document.querySelectorAll('.ytp-progress-bar') as NodeListOf<HTMLElement>;
|
||||||
this.progressBar = findValidElement(allProgressBars) ?? allProgressBars?.[0];
|
this.progressBar = findValidElement(allProgressBars) ?? allProgressBars?.[0];
|
||||||
|
|
||||||
const newChapterBar = this.progressBar.querySelector(".ytp-chapters-container:not(.sponsorBlockChapterBar)") as HTMLElement;
|
if (this.progressBar) {
|
||||||
if (this.originalChapterBar !== newChapterBar) {
|
const newChapterBar = this.progressBar.querySelector(".ytp-chapters-container:not(.sponsorBlockChapterBar)") as HTMLElement;
|
||||||
// Make sure changes are undone on old bar
|
if (this.originalChapterBar !== newChapterBar) {
|
||||||
this.originalChapterBar?.style?.removeProperty("display");
|
// Make sure changes are undone on old bar
|
||||||
|
this.originalChapterBar?.style?.removeProperty("display");
|
||||||
|
|
||||||
this.originalChapterBar = newChapterBar;
|
this.originalChapterBar = newChapterBar;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private update(): void {
|
private update(): void {
|
||||||
|
|||||||
Reference in New Issue
Block a user