Greasy Fork 支持简体中文。

斗鱼(广告/活动/弹幕)屏蔽

屏蔽部分斗鱼直播间无意义广告、活动、弹幕

目前為 2018-09-18 提交的版本,檢視 最新版本

// ==UserScript==
// @name         斗鱼(广告/活动/弹幕)屏蔽
// @namespace    http://tampermonkey.net/
// @version      0.0.15
// @description  屏蔽部分斗鱼直播间无意义广告、活动、弹幕
// @author       hulala
// @match        *://www.douyu.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    var time = 0;
    

    var removeAD = function(){
        var gifts = $("#listId").parent().parent();
        var chat = $(".PlayerCaseSub-Main.is-unlogin");
        var ads = new Array(
            ".room-ad-video-down",
            ".valentine1807",
            ".adsRoot_7c5z4",
            ".chat-ad",
            "#js-annual1809",
            ".Annual1809",
            ".room-ad-bottom",
            "#js-chat-notice",
            ".column.rec",
            "#js-recommand",
            ".recommendAD-824567",
            ".recommendApp-cbeff7",
            ".broadcastDiv-343e1a",
            ".PaladinPop",
            ".no-login"
        );
    
        for (var i = 0;i<ads.length; i++){
            $(ads[i]).css("display", "none");
        }
        gifts.css("display","none");
        chat.css("top", "0px");
    }

    removeAD();

    var timer = window.setInterval(function() {
        removeAD();
        time++;
        if(time >= 15 && timer) {
            window.clearInterval(timer);
            timer = null;
        }
    }, 3000);

    var removeWelcome = function(){
        $('.jschartli')
            .filter(function(index, element){
                return $(element).has('[chatid]').length === 0
            })
            .remove();
    }

    window.setInterval(function(){removeWelcome()}, 1000);
})();