diff options
author | Ajay <[email protected]> | 2024-10-01 23:07:16 -0400 |
---|---|---|
committer | Ajay <[email protected]> | 2024-10-01 23:07:16 -0400 |
commit | 86f8809de7286ccea2c8de76bed7ac1a90f217ea (patch) | |
tree | 8e83ea5dd0f2f18688eaabe64bf84fd482d637e1 | |
parent | 3bddd0405c15b30320d1d1e4ee8d4f14cf0d2682 (diff) | |
download | SponsorBlock-86f8809de7286ccea2c8de76bed7ac1a90f217ea.tar.gz SponsorBlock-86f8809de7286ccea2c8de76bed7ac1a90f217ea.zip |
Fix time without skips on new YouTube design
-rw-r--r-- | src/content.ts | 11 |
1 files 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); } |