Skip to content

fix: Apply Hide YouTube Playables on load and cover all Playables shelves (#48) - #49

Merged
KartikRashmin merged 2 commits into
KartikRashmin:mainfrom
wiredmatt:fix/hide-playables-initial-load
Nov 27, 2026
Merged

KartikRashmin merged 2 commits into
KartikRashmin:mainfrom
wiredmatt:fix/hide-playables-initial-load

Conversation

@wiredmatt

@wiredmatt wiredmatt commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Resolves #48.

The Hide YouTube Playables setting was only applied when toggled or when the Clean Homepage Feed master toggle was enabled. On a normal page load, runAll() never called hidePlayables(), so the shelf stayed visible until the user toggled the setting off and on. This wires the setting into the normal settings flow, widens shelf detection, and covers Playables surfaces outside the home feed.

Key Changes

  • Settings wiring:
    • hidePlayables() is now called from runAll() when Clean Homepage Feed is off, and reverted in restoreAllElements().
    • Fixes the setting being ignored on initial page load and after hard refreshes.
  • Broader shelf detection:
    • Matches any link containing /playables instead of an exact href="/playables".
    • Handles trailing slashes, query strings and locale-prefixed URLs.
    • Covers ytd-rich-section-renderer, ytd-rich-shelf-renderer, grid-shelf-view-model and ytd-horizontal-card-list-renderer.
    • Also covers the newer mini-game-card-view-model shelves used on the Gaming page (/gaming).
  • Zero-Flicker Instant Hiding:
    • Injects an instant display: none !important stylesheet for Playables shelves so lazily rendered shelves never flash into view.
    • Mutation observer keeps late-rendered shelves hidden.
  • Tests:
    • Verified on the live YouTube home feed and /gaming page in Brave.
    • Confirmed only the Playables shelf is hidden on /gaming; the other shelves remain visible.
    • Verified a lazily added Playables shelf is hidden and that disabling the setting restores everything.
    • node --check passes for homepage.js and index.js.
  • CI:
    • Skip the PR comment steps for fork pull requests, where GITHUB_TOKEN is read-only and those steps were failing with 403 Resource not accessible by integration.

…elf variants

- Wire hidePlayables into runAll and restoreAllElements so the setting applies on initial load and is reverted when the extension is disabled.
- Broaden Playables link detection from an exact href of /playables to any link containing /playables (covers trailing slashes, query strings, and locale-prefixed URLs).
- Cover rich-section, rich-shelf, grid-shelf and horizontal-card-list renderers, including the newer mini-game-card shelves on the Gaming page.
- Inject an instant-hide stylesheet so lazily rendered Playables shelves never flash into view.
The GITHUB_TOKEN is read-only for pull_request workflows triggered from forks, so creating or updating PR comments fails with 403 (Resource not accessible by integration) even when the audit and build jobs succeed. Skip those comment steps when the PR head is not in the base repository.
@KartikRashmin
KartikRashmin merged commit b61aeaa into KartikRashmin:main Nov 27, 2026
7 checks passed
@KartikRashmin

Copy link
Copy Markdown
Owner

Thanks for catching this and putting together such a clean fix, @wiredmatt!

Everything looks solid, all CI, lint, and security checks passed, and I've merged this into main. Appreciate the contribution (especially the /gaming surface coverage and the fork PR CI fix)!

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.

[BUG] Hide YouTube Playables setting is ignored on initial page load

2 participants