[直播用]将HLTV台湾地区旗帜替换为中国国旗

将HLTV台湾地区旗帜替换为中国国旗,规避审核

// ==UserScript==
// @name         [直播用]将HLTV台湾地区旗帜替换为中国国旗
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  将HLTV台湾地区旗帜替换为中国国旗,规避审核
// @author       cirno
// @match        https://www.hltv.org/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    function replaceFlags() {
        document.querySelectorAll('img[src*="/flags/30x20/TW.gif"]').forEach(img => {
            img.src = "https://www.hltv.org/img/static/flags/30x20/CN.gif";
        });
    }

    // Initial replacement
    replaceFlags();

    // Observe DOM changes for dynamically loaded content
    const observer = new MutationObserver(replaceFlags);
    observer.observe(document.body, { childList: true, subtree: true });
})();