Skip to content

fix #3477: blank timer when "show remaining duration" is enabled#3483

Merged
ImprovedTube merged 2 commits intocode-charity:masterfrom
root-sarvesh:fix/remaining-time-display
Dec 20, 2025
Merged

fix #3477: blank timer when "show remaining duration" is enabled#3483
ImprovedTube merged 2 commits intocode-charity:masterfrom
root-sarvesh:fix/remaining-time-display

Conversation

@root-sarvesh
Copy link
Contributor

Fixes #3477

Problem

When enabling “Show video remaining duration”, the video time display becomes a blank bubble.
Sometimes only the separator (/) remains visible.

This issue:

  • Occurs on Firefox and Chrome
  • Happens even when logged out
  • Appears after a recent YouTube UI update
  • Disappears when the setting is disabled and the page is refreshed

Root Cause

YouTube’s updated player UI splits the timer into multiple elements:

  • .ytp-time-current
  • .ytp-time-separator
  • .ytp-time-duration

The previous logic hid or replaced parts of this structure.
As a result, YouTube continued updating the timer internally, but the visible text nodes were missing, leaving a blank display.


Solution

This fix preserves YouTube’s native timer structure instead of hiding elements.

Changes made:

  • Cache the original duration text once using dataset
  • Avoid modifying the current-time element (which YouTube updates every tick)
  • Append the remaining time to the duration text only
  • Keep YouTube’s separator and DOM layout intact
  • Run updates within ImprovedTube’s existing player update loop

Result

The timer now renders correctly as:

1:27 / 5:42 (-04:15)

Tested on

  • Firefox
  • Chrome
  • Logged in and logged out

@ImprovedTube ImprovedTube merged commit 1fa8e80 into code-charity:master Dec 20, 2025
1 check passed
@ImprovedTube
Copy link
Member

hi @root-sarvesh
it seems some elements in appearance : player are duplicated? ; #3471 @dodieboy
thank you very much!

@dodieboy
Copy link
Member

dodieboy commented Dec 20, 2025

I don't think my previous PR caused the duplicate in appearance->player, but will double check later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐞 Setting "Show video remaining duration" TRUE causes the video timer to disappear completely.

3 participants