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 <noreply@anthropic.com>
This commit is contained in:
Lawrence Hook
2026-02-08 19:50:37 -05:00
parent a3542e42da
commit ef85e9ef02
4 changed files with 18 additions and 0 deletions
+1
View File
@@ -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,
+9
View File
@@ -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']) {
+2
View File
@@ -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();
}
+6
View File
@@ -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',
};