AWBW Viewer Count Hider

Hides viewer count

// ==UserScript==
// @name         AWBW Viewer Count Hider
// @namespace    https://awbw.amarriner.com/
// @version      1.0
// @description  Hides viewer count
// @icon         https://awbw.amarriner.com/favicon.ico
// @author       lol
// @match        https://awbw.amarriner.com/game.php?games_id=*
// @grant        none
// @license       MIT
// ==/UserScript==

(function () {
    'use strict';

    function hideViewerCount(node) {
        const viewer = node.querySelector('.game-viewer-count');
        if (viewer) {
            const cover = document.createElement('span');
            cover.textContent = '???';
            cover.style.fontWeight = 'bold';
            cover.style.color = '#000';
            node.replaceWith(cover);
        }
    }

    document.querySelectorAll('span.small_text_14.bold').forEach(hideViewerCount);

    const observer = new MutationObserver(mutations => {
        for (const mutation of mutations) {
            for (const node of mutation.addedNodes) {
                if (node.nodeType === 1) {
                    if (node.matches && node.matches('span.small_text_14.bold')) {
                        hideViewerCount(node);
                    } else if (node.querySelector) {
                        const match = node.querySelector('span.small_text_14.bold');
                        if (match) hideViewerCount(match);
                    }
                }
            }
        }
    });

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

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址