Hide Twitch React Button

Hide the react button on Twitch

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Hide Twitch React Button
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Hide the react button on Twitch
// @author       Welshdroo
// @match        https://www.twitch.tv/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Wait for the page to load
    window.addEventListener('load', function() {
        // Function to hide the react button
        function hideReactButton() {
            // Find the react button by class name and hide it
            var reactButton = document.querySelector('.ScCoreButton-sc-ocjdkq-0.ScCoreButtonText-sc-ocjdkq-3');
            if (reactButton) {
                reactButton.style.display = 'none';
            }
        }

        // Run the function initially
        hideReactButton();

        // Set up an observer to handle dynamic changes in the DOM
        var observer = new MutationObserver(function(mutations) {
            mutations.forEach(function(mutation) {
                // Run the function whenever the DOM changes
                hideReactButton();
            });
        });

        // Configuration of the observer
        var config = { attributes: true, childList: true, subtree: true };

        // Start observing the target node for configured mutations
        observer.observe(document.body, config);
    });
})();