斗鱼网页版 - 播放界面纯净模式

净化斗鱼主界面,让直播回归纯净模式

目前為 2022-06-02 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         斗鱼网页版 - 播放界面纯净模式
// @namespace    http://tampermonkey.net/
// @version      0.8
// @description  净化斗鱼主界面,让直播回归纯净模式
// @author       yaochao
// @match        https://www.douyu.com/*
// @icon         https://www.google.com/s2/favicons?domain=douyu.com
// @grant        none
// @require      https://cdn.staticfile.org/jquery/3.5.0/jquery.min.js
// @license MIT
// ==/UserScript==

(function() {
    'use strict';
    var $ = window.$ || $;

    // 屏蔽斗鱼 p2p 上传和下载
    //window.RTCPeerConnection = window.webkitRTCPeerConnection = window.mozRTCPeerConnection = null
    window.RTCDataChannel = window.DataChannel = null

    // 定时3秒后,把多余的元素删除,修改部分组件的样式
    setTimeout(function(){
        $('#js-room-activity,.layout-Player-announce,.TreasureWrap,.PlayerToolbar').remove();
        $('.layout-Player-video').css('bottom', '0');
        $('.layout-Player-rank').css('top', '0');
        $('.layout-Player-barrage').css('top', '217px');
        $('#js-player-toolbar').css('height', '0')
        $('.ChatTabContainer-titleWraper--tabTitle li').eq(0).addClass('is-active');
        $('.ChatTabContainer-titleWraper--tabTitle li').eq(3).removeClass('is-active');
        $('.ChatTabContainer-conWraper div').eq(0).addClass('is-active');
        $('.ChatTabContainer-conWraper div').eq(3).removeClass('is-active');
        // 移除放录像的直播间
        $(".DyLiveCover-videoLogo").parent().parent().parent().parent().parent().remove();
        // 移除关播的直播间
        $(".DyLiveRecord-message").parent().parent().parent().parent().parent().remove();
        // 移除关注列表中可能感兴趣的推荐卡片
        $(".AthenaBoothPanel-wrapper").parent().parent().remove();
        // 移除我的关注列表中无用的元素
        //$(".layout-Module-head,.ListFooter").remove();
        $(".ListFooter").remove();
        // 移除直播间内弹幕提醒
        $(".Barrage-notice").remove();
        // 选择清晰度最高的画质
        // $("li[class^=selected-]").parent().children()[0].click()
    },3000);

})();