From 86f8809de7286ccea2c8de76bed7ac1a90f217ea Mon Sep 17 00:00:00 2001 From: Ajay Date: Tue, 1 Oct 2024 23:07:16 -0400 Subject: Fix time without skips on new YouTube design --- src/content.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/content.ts b/src/content.ts index c62865b2..b4d16964 100644 --- a/src/content.ts +++ b/src/content.ts @@ -2634,11 +2634,11 @@ function showTimeWithoutSkips(skippedDuration: number): void { } // YouTube player time display - const displayClass = - isOnInvidious() ? "vjs-duration" : - isOnMobileYouTube() ? "ytm-time-display" : - "ytp-time-display.notranslate"; - const display = document.querySelector(`.${displayClass}`); + const selector = + isOnInvidious() ? ".vjs-duration" : + isOnMobileYouTube() ? ".ytm-time-display" : + ".ytp-time-display.notranslate .ytp-time-wrapper"; + const display = document.querySelector(selector); if (!display) return; const durationID = "sponsorBlockDurationAfterSkips"; @@ -2648,7 +2648,6 @@ function showTimeWithoutSkips(skippedDuration: number): void { if (duration === null) { duration = document.createElement('span'); duration.id = durationID; - if (!isOnInvidious()) duration.classList.add(displayClass); display.appendChild(duration); } -- cgit v1.2.3