From ef85e9ef0248f996879ede35cf4cb368b5d80766 Mon Sep 17 00:00:00 2001 From: Lawrence Hook Date: Sun, 8 Feb 2026 19:50:37 -0500 Subject: [PATCH] feat: add option to hide YouTube Playables (closes #158, closes #175) Also auto-select Homepage section in options when on YouTube homepage. Co-Authored-By: Claude Opus 4.6 --- src/content-script/main.css | 1 + src/content-script/main.js | 9 +++++++++ src/options/main.js | 2 ++ src/shared/main.js | 6 ++++++ 4 files changed, 18 insertions(+) diff --git a/src/content-script/main.css b/src/content-script/main.css index c6b687f..79442ee 100644 --- a/src/content-script/main.css +++ b/src/content-script/main.css @@ -57,6 +57,7 @@ html[global_enable="true"][remove_all_but_one="true"] ytd-browse[page-subtype="h html[global_enable="true"][remove_all_but_one="true"] ytd-browse[page-subtype="home"] ytd-rich-grid-renderer > #contents > ytd-continuation-item-renderer, html[global_enable="true"][remove_extra_rows="true"] ytd-browse[page-subtype="home"] ytd-rich-grid-renderer > #contents > ytd-rich-grid-row + ytd-rich-section-renderer, html[global_enable="true"][remove_infinite_scroll="true"] ytd-browse[page-subtype="home"] ytd-rich-grid-renderer > #contents > ytd-continuation-item-renderer, +html[global_enable="true"][remove_playables="true"] *[is_playable], /* Video Player - UX */ html[global_enable="true"][disable_fullscreen_scroll="true"] ytd-watch-flexy[fullscreen] div#columns, diff --git a/src/content-script/main.js b/src/content-script/main.js index be1c047..8cf92fd 100644 --- a/src/content-script/main.js +++ b/src/content-script/main.js @@ -183,6 +183,15 @@ function runDynamicSettings() { }); } + // Hide playables + if (cache['remove_playables']) { + const playableCards = qsa('ytd-mini-game-card-view-model'); + playableCards?.forEach(card => { + const shelfContainer = card.closest('ytd-rich-section-renderer'); + shelfContainer?.setAttribute('is_playable', ''); + }); + } + // Channel page option if (onChannel) { if (cache['remove_channel_for_you']) { diff --git a/src/options/main.js b/src/options/main.js index 666ee4e..7628b92 100644 --- a/src/options/main.js +++ b/src/options/main.js @@ -152,6 +152,8 @@ function populateOptions(SECTIONS, headerSettings, SETTING_VALUES) { qs('.sidebar_section[tag="Subscriptions"]').click(); } else if (channelRegex.test(currentUrl)) { qs('.sidebar_section[tag="Channel"]').click(); + } else if (homepageRegex.test(currentUrl)) { + qs('.sidebar_section[tag="Homepage"]').click(); } else { qs('.sidebar_section[tag="Basic"]').click(); } diff --git a/src/shared/main.js b/src/shared/main.js index 5cd631e..ba820e2 100644 --- a/src/shared/main.js +++ b/src/shared/main.js @@ -105,6 +105,11 @@ const SECTIONS = [ id: "remove_infinite_scroll", defaultValue: false }, + { + name: "Hide Playables", + id: "remove_playables", + defaultValue: false + }, ] }, { @@ -741,6 +746,7 @@ const idToShortId = { "log_prompt_answered": '92', "remove_results_description": '93', "enable_theater": '94', + "remove_playables": '95', };