Greasy Fork is available in English.

Remove Channels from WhatsApp Web

Removes the Channels button from the WhatsApp Web interface

// ==UserScript==
// @name         Remove Channels from WhatsApp Web
// @namespace    mailto:mastertohno@gmail.com
// @version      1.0
// @description  Removes the Channels button from the WhatsApp Web interface
// @author       Mastah Shiki Tohno
// @match        *://web.whatsapp.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=whatsapp.com
// @grant        none
// @license      MIT
// ==/UserScript==

(function () {
    'use strict';
    if (!Element.prototype.matches) {
        Element.prototype.matches =
            Element.prototype.matchesSelector ||
            Element.prototype.mozMatchesSelector ||
            Element.prototype.msMatchesSelector ||
            Element.prototype.oMatchesSelector ||
            Element.prototype.webkitMatchesSelector;
    }

    var getParent = function (node) {
        while (node && node.parentNode) {
            return node.parentNode;
        }
    };

    const observer = new MutationObserver(function (mutations, mutationInstance) {
        const archivedButton = document.querySelectorAll(`[aria-label="Channels"]`);
        document.querySelectorAll(`[aria-label="Channels"]`).forEach(function (v) {
            var node = getParent(v);
            if (node) {
                node.remove();
            }
        });
    });

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