Skip to content

fix: prevent time display hiding when remaining duration is enabled#3671

Merged
ImprovedTube merged 1 commit intocode-charity:masterfrom
majiayu000:fix/3611-time-display-hidden
Mar 7, 2026
Merged

fix: prevent time display hiding when remaining duration is enabled#3671
ImprovedTube merged 1 commit intocode-charity:masterfrom
majiayu000:fix/3611-time-display-hidden

Conversation

@majiayu000
Copy link
Contributor

Fixes #3611

Problem

playerRemainingDuration() overwrites durationEl.textContent directly, which triggers YouTube's Polymer framework to set display: none !important on .ytp-time-contents, hiding the entire time display.

Fix

  • Use a separate <span class="ytp-time-remaining-duration"> element appended after the duration, instead of overwriting the original text
  • Simplify cleanup: only remove the added span on disable, no need to force-reset display styles on .ytp-time-contents

Test

  • Added tests/unit/remaining-duration.test.js
  • All existing tests pass

…lay hiding (code-charity#3611)

YouTube's framework hides .ytp-time-contents when its textContent is
modified directly. Use a separate span element instead of overwriting
the duration text, and simplify cleanup by only removing the added element.
Signed-off-by: majiayu000 <1835304752@qq.com>
@ImprovedTube ImprovedTube merged commit d51d8f7 into code-charity:master Mar 7, 2026
1 check passed
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.

🐞Time display does not appear

2 participants