mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-08 12:37:05 +03:00
Fixed invidious preview bar
This commit is contained in:
@@ -418,7 +418,7 @@ function createPreviewBar(): void {
|
|||||||
const el = document.querySelectorAll(selector);
|
const el = document.querySelectorAll(selector);
|
||||||
|
|
||||||
if (el && el.length && el[0]) {
|
if (el && el.length && el[0]) {
|
||||||
previewBar = new PreviewBar(el[0], onMobileYouTube);
|
previewBar = new PreviewBar(el[0], onMobileYouTube, onInvidious);
|
||||||
|
|
||||||
updatePreviewBar();
|
updatePreviewBar();
|
||||||
|
|
||||||
|
|||||||
@@ -13,16 +13,18 @@ class PreviewBar {
|
|||||||
container: HTMLUListElement;
|
container: HTMLUListElement;
|
||||||
parent: any;
|
parent: any;
|
||||||
onMobileYouTube: boolean;
|
onMobileYouTube: boolean;
|
||||||
|
onInvidious: boolean;
|
||||||
|
|
||||||
timestamps: number[][];
|
timestamps: number[][];
|
||||||
types: string;
|
types: string;
|
||||||
|
|
||||||
constructor(parent, onMobileYouTube) {
|
constructor(parent, onMobileYouTube, onInvidious) {
|
||||||
this.container = document.createElement('ul');
|
this.container = document.createElement('ul');
|
||||||
this.container.id = 'previewbar';
|
this.container.id = 'previewbar';
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
|
|
||||||
this.onMobileYouTube = onMobileYouTube;
|
this.onMobileYouTube = onMobileYouTube;
|
||||||
|
this.onInvidious = onInvidious;
|
||||||
|
|
||||||
this.updatePosition(parent);
|
this.updatePosition(parent);
|
||||||
|
|
||||||
@@ -30,7 +32,7 @@ class PreviewBar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setupHoverText() {
|
setupHoverText() {
|
||||||
if (this.onMobileYouTube) return;
|
if (this.onMobileYouTube || this.onInvidious) return;
|
||||||
|
|
||||||
let seekBar = document.querySelector(".ytp-progress-bar-container");
|
let seekBar = document.querySelector(".ytp-progress-bar-container");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user