No Relevant Subscriptions Tab

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

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램을 설치해야 합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

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