douyu ad block

斗鱼广告屏蔽 douyu ad block

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         douyu ad block
// @namespace    http://tampermonkey.net/
// @version      2025-09-22
// @description  斗鱼广告屏蔽 douyu ad block
// @author       wumail
// @match        https://www.douyu.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=douyu.com
// @grant        none
// @license      MIT
// ==/UserScript==
 
(function () {
    'use strict';
    function deleteElement(tag){
        const fn = (timer) => {
            const target = document.querySelectorAll(tag)

            if (target.length) {
                try{
                    clearInterval(timer)
                    for (let i = 0; i < target.length; i++) {
                        target[i].remove()
                    }
                }catch(error) {
                    console.error("!!")
                }
            }
        }
        let count = 50;
        let timer = setInterval(() => {
            if(count <= 0){
                clearInterval(timer)
            }
            fn(timer)
            count--
            console.log(count)
        }, 200)
        }
    window.addEventListener("load", (event) => {
        const elementsToDelete = [
            ".layout-Main > .layout-Banner",
            "#root > .bc-wrapper",
            ".layout-Main > #js-room-top-banner",
            "#js-room-activity",
            ".Title-ad",
            "#webmActKefuWeidget",
            ".IconCardAdBoundsBox",
            ".RechangeJulyPopups",
            ".aside-top-uspension-video-box  ",
            ".layout-Player-asideTopSuspension",
            ".Game",
            ".Video",
            ".room-top-banner-box",
            ".activeContainer__8Qxzw",
            ".werbungContainer__2sv7h",
            ".layout-Aside"
        ]

        elementsToDelete.forEach(ele => {
            const tag = ele
            deleteElement(tag)
        })
    });
})();