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

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

当前为 2022-06-02 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

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

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 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);

})();