No Relevant Subscriptions Tab

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==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();
})();