No Relevant Subscriptions Tab

Hides and removes the Most relevant shelf from YouTube subscriptions feed.

Voor het installeren van scripts heb je een extensie nodig, zoals Tampermonkey, Greasemonkey of Violentmonkey.

Voor het installeren van scripts heb je een extensie nodig, zoals {tampermonkey_link:Tampermonkey}.

Voor het installeren van scripts heb je een extensie nodig, zoals Tampermonkey of Violentmonkey.

Voor het installeren van scripts heb je een extensie nodig, zoals Tampermonkey of Userscripts.

Voor het installeren van scripts heb je een extensie nodig, zoals {tampermonkey_link:Tampermonkey}.

Voor het installeren van scripts heb je een gebruikersscriptbeheerder nodig.

(Ik heb al een user script manager, laat me het downloaden!)

Voor het installeren van gebruikersstijlen heb je een extensie nodig, zoals {stylus_link:Stylus}.

Voor het installeren van gebruikersstijlen heb je een extensie nodig, zoals {stylus_link:Stylus}.

Voor het installeren van gebruikersstijlen heb je een extensie nodig, zoals {stylus_link:Stylus}.

Voor het installeren van gebruikersstijlen heb je een gebruikersstijlbeheerder nodig.

Voor het installeren van gebruikersstijlen heb je een gebruikersstijlbeheerder nodig.

Voor het installeren van gebruikersstijlen heb je een gebruikersstijlbeheerder nodig.

(Ik heb al een beheerder - laat me doorgaan met de installatie!)

// ==UserScript==
// @name         No Relevant Subscriptions Tab
// @license      MIT
// @namespace    https://youtube.com/
// @version      1.0
// @description  Hides and removes the Most relevant shelf from YouTube subscriptions feed.
// @author       BergNetworks
// @match        https://www.youtube.com/feed/subscriptions
// @match        https://youtube.com/feed/subscriptions
// @run-at       document-start
// @grant        none
// @icon         data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMDAiIGhlaWdodD0iMjAwIiB2aWV3Qm94PSIwIDAgMTAyNCA3NjgiIGZpbGw9IiMwMDAwMDAiPjxwYXRoIGZpbGw9IiMwMDAwMDAiIGQ9Ik05MjggNzM2cS0yMjIgMzItNDE2IDMycS04NiAwLTE5MC04dC0xNjUtMTZsLTYxLThxLTI3LTUtNDcuNS0zNy41dC0zMC03OC41dC0xNC04NlQwIDQ2MVYzMDdRMCA1MiA5NiAzMlEzMTggMCA1MTIgMHE4NiAwIDE5MCA4dDE2NSAxNmw2MSA4cTI5IDQgNDkuNSAzNi41VDEwMDcgMTQ4dDEzIDg2dDQgNzN2MTU0cTAgMzYtMyA3M3QtMTIgODV0LTMwIDgwdC01MSAzN3pNNjkzIDM1OUw0MzEgMTk5cS0xMS0xMC0yOS01LjVUMzg0IDIwOHYzNTJxMCAxMSAxOCAxNXQyOS02bDI2Mi0xNjBxMTEtMTAgMTEtMjV0LTExLTI1eiIvPjwvc3ZnPg==
// ==/UserScript==

(function () {
    'use strict';

    function isSubscriptionsPage() {
        return location.hostname.endsWith('youtube.com') &&
               location.pathname === '/feed/subscriptions';
    }

    function injectCss() {
        const style = document.createElement('style');
        style.textContent = `
            ytd-rich-section-renderer:has(ytd-rich-shelf-renderer #title)
            {
            }

            ytd-rich-section-renderer:has(ytd-rich-shelf-renderer #title),
            ytd-rich-section-renderer:has(span#title)
            {
            }
        `;
        document.documentElement.appendChild(style);
    }

    function removeMostRelevantShelves() {
        if (!isSubscriptionsPage()) return;

        const sections = document.querySelectorAll('ytd-rich-section-renderer');

        for (const section of sections) {
            const title = section.querySelector('#title');
            if (!title) continue;

            const text = (title.textContent || '').trim();
            if (text === 'Most relevant') {
                section.remove();
            }
        }
    }

    function startObserver() {
        const observer = new MutationObserver(() => {
            removeMostRelevantShelves();
        });

        observer.observe(document.documentElement, {
            childList: true,
            subtree: true
        });

        removeMostRelevantShelves();
    }

    function init() {
        if (!isSubscriptionsPage()) return;
        injectCss();
        removeMostRelevantShelves();
        startObserver();
    }

    window.addEventListener('yt-navigate-finish', init);
    window.addEventListener('load', init);
    init();
})();