Greasy Fork

来自缓存

Greasy Fork is available in English.

直播 屏蔽弹幕 (目前 huya,douyu)

直播弹幕屏蔽,目前 支持 huya,douyu

// ==UserScript==
// @name         直播 屏蔽弹幕 (目前 huya,douyu)
// @namespace    https://github.com/unkownY/TamperMonkey-script
// @version      0.1
// @description  直播弹幕屏蔽,目前 支持 huya,douyu
// @author       unkownY
// @match        *://www.huya.com/*
// @match        *://www.douyu.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Your code here...

    let host = window.location.host;

    switch(host){
        case host.includes('huya'):
            let huya = setInterval(function(){
                let danmuwrap = document.getElementById('danmuwrap');
                if(danmuwrap) {
                    danmuwrap.style.opacity = 0;
                    clearInterval(huya);
                }
            },1000);
            break;
        case host.includes('douyu'):
            let douyu = setInterval(function(){
                let jsPlayerVideo = document.getElementById('js-player-video');
                if(jsPlayerVideo) {
                    jsPlayerVideo.style.opacity = 0;
                    clearInterval(douyu);
                }
            },1000);
            break;
        default:
            console.log('It\'s not right');
    }

})();