TwitchUnrecommend

Removes the left nav bars

// ==UserScript==
// @name           TwitchUnrecommend
// @version        1.09081
// @description    Removes the left nav bars
// @match          https://*.twitch.tv/*

// @run-at         document-end
// @namespace      https://greasyfork.org/users/1359318
// ==/UserScript==

window.onload = function () {

    document.querySelectorAll(".side-nav-section").forEach(entry => {
        if (entry.ariaLabel !== 'Followed Channels') {
            entry.style.setProperty("display", "none", "important");
        }
    });

    const targetNode = document.getElementById("root");
    const config = { childList: true, subtree: true };

    const callback = (mutationList, observer) => {
        for (const mutation of mutationList) {
            mutation.addedNodes.forEach(entry => {
                if (entry.ariaLabel != null && (entry.ariaLabel === 'Recommended Channels' || entry.ariaLabel.endsWith('Viewers Also Watch'))) {
                    entry.style.setProperty("display", "none", "important");
                }
            });
        }
    };

    const observer = new MutationObserver(callback);
    observer.observe(targetNode, config);

}