From f32e2e6b5cdd259097044967a4c4d674fc7c0e28 Mon Sep 17 00:00:00 2001 From: Young Shung Date: Sun, 7 Apr 2024 19:53:27 +0800 Subject: [PATCH] stop progress bar injection if already exists some accounts that already have YouTube's own progress bar will cause error when trying to inject our own progress bar --- src/lib/ProgressBar.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/ProgressBar.ts b/src/lib/ProgressBar.ts index 86745fb..b7741e0 100644 --- a/src/lib/ProgressBar.ts +++ b/src/lib/ProgressBar.ts @@ -13,6 +13,9 @@ export function modifyProgressBar(enabled: boolean) { //[id="0"] > div.overlay.style-scope.ytd-reel-video-renderer > ytd-reel-player-overlay-renderer > #overlay const progressBar = getProgressBarList() as HTMLElement; // ? the progressbar itself + + // Some accounts already have YouTube's progress bar, no need to add our own + if (!progressBar) return; const pbBackground = progressBar.children[0] as HTMLElement; // ? the grey background of the bar const pbForeground = progressBar.children[1] as HTMLElement; // ? The red part of the progress bar