From 26a514aa73ce42872b647dcc8a5c6b0d03440df3 Mon Sep 17 00:00:00 2001 From: Lawrence Hook Date: Sun, 15 Mar 2026 17:13:15 -0400 Subject: [PATCH] add option to hide "Most relevant" section on subscriptions page Co-Authored-By: Claude Opus 4.6 --- src/content-script/main.css | 1 + src/content-script/main.js | 15 ++++++++++++++- src/shared/main.js | 7 +++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/content-script/main.css b/src/content-script/main.css index 56500e2..0d78865 100644 --- a/src/content-script/main.css +++ b/src/content-script/main.css @@ -126,6 +126,7 @@ html[global_enable="true"][remove_sub_upcoming="true"] ytd-rich-item-renderer[ba html[global_enable="true"][remove_sub_premiere="true"] ytd-rich-item-renderer[badge-text="premiere"], html[global_enable="true"][remove_sub_vods="true"] ytd-rich-item-renderer[is_vod], +html[global_enable="true"][remove_sub_most_relevant="true"] ytd-rich-section-renderer[is_most_relevant], /* Other */ html[global_enable="true"][remove_notif_bell="true"] ytd-notification-topbar-button-renderer, diff --git a/src/content-script/main.js b/src/content-script/main.js index 7f9c380..be4518e 100644 --- a/src/content-script/main.js +++ b/src/content-script/main.js @@ -262,7 +262,8 @@ function runDynamicSettings() { // Subscriptions page options (only if any sub-page settings are enabled) const subsSettingsEnabled = cache['remove_sub_shorts'] || cache['remove_sub_live'] || - cache['remove_sub_upcoming'] || cache['remove_sub_premiere'] || cache['remove_sub_vods']; + cache['remove_sub_upcoming'] || cache['remove_sub_premiere'] || cache['remove_sub_vods'] || + cache['remove_sub_most_relevant']; if (onSubs && subsSettingsEnabled) { const badgeSelector = 'ytd-badge-supported-renderer'; const upcomingBadgeSelector = 'ytd-thumbnail-overlay-time-status-renderer[overlay-style="UPCOMING"]'; @@ -304,6 +305,18 @@ function runDynamicSettings() { updatedGridVideo?.setAttribute('is_vod', ''); }); + // "Most relevant" shelf + if (cache['remove_sub_most_relevant']) { + const shelves = qsa('ytd-rich-section-renderer ytd-rich-shelf-renderer'); + shelves.forEach(shelf => { + const title = qs('span#title', shelf); + if (title?.innerText.trim().toLowerCase() === 'most relevant') { + const section = shelf.closest('ytd-rich-section-renderer'); + section?.setAttribute('is_most_relevant', ''); + } + }); + } + // Reduce empty space. const subsRows = qsa('ytd-rich-grid-row'); subsRows.forEach(row => { diff --git a/src/shared/main.js b/src/shared/main.js index 03b3719..85dda8d 100644 --- a/src/shared/main.js +++ b/src/shared/main.js @@ -521,6 +521,12 @@ const SECTIONS = [ defaultValue: false, premium: true, }, + { + name: "Hide \"Most relevant\" section", + id: "remove_sub_most_relevant", + defaultValue: false, + premium: true, + }, { name: "Hide live videos", id: "remove_sub_live", @@ -818,6 +824,7 @@ const idToShortId = { "remove_results_description": '93', "enable_theater": '94', "remove_playables": '95', + "remove_sub_most_relevant": '96', };