diff --git a/src/chrome_manifest.json b/src/chrome_manifest.json index ae42cb5..86d6196 100644 --- a/src/chrome_manifest.json +++ b/src/chrome_manifest.json @@ -3,7 +3,7 @@ "description": "Spend less time on YouTube. Customize YouTube's user interface to be less engaging.", "homepage_url": "https://github.com/lawrencehook/remove-youtube-suggestions", "manifest_version": 3, - "version": "4.3.74", + "version": "4.3.75", "icons": { "16": "/images/16.png", 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/firefox_manifest.json b/src/firefox_manifest.json index b911da8..8cec5fa 100644 --- a/src/firefox_manifest.json +++ b/src/firefox_manifest.json @@ -3,7 +3,7 @@ "description": "Spend less time on YouTube. Customize YouTube's user interface to be less engaging.", "homepage_url": "https://github.com/lawrencehook/remove-youtube-suggestions", "manifest_version": 2, - "version": "4.3.74", + "version": "4.3.75", "icons": { "16": "/images/16.png", 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', };