UWOSLAB Fixer

Replace UWOSLAB Channel name on Twitch with "You Woah Slab (UWOSLAB)"

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

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

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         UWOSLAB Fixer
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Replace UWOSLAB Channel name on Twitch with "You Woah Slab (UWOSLAB)"
// @author       DaxDaFox
// @match        *://*/*
// @grant        none
// @run-at       document-end
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    function replaceText() {
        // Use the exact CSS selector provided
        const elements = document.querySelectorAll('.tw-title.ioKjUT.InjectLayout-sc-1i43xsx-0.lbYztg.bqyYtA.ScTitleText-sc-d9mj2s-0.CoreText-sc-1txzju1-0');
        
        elements.forEach(element => {
            if (element.textContent.trim() !== "You Woah Slab (UWOSLAB)") {
                element.textContent = "You Woah Slab (UWOSLAB)";
                console.log('Replaced text in element:', element);
            }
        });
    }

    // run
    replaceText();

    const observer = new MutationObserver(function(mutations) {
        mutations.forEach(function(mutation) {
            if (mutation.type === 'childList' && mutation.addedNodes.length > 0) {
                // Small delay to ensure elements are fully rendered
                setTimeout(replaceText, 100);
            }
        });
    });

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

    //run periodically as a fallback
    setInterval(replaceText, 2000);
})();