UWOSLAB Fixer

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

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

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