bilibili直播精简

精简了bilibili的直播页面

目前为 2016-11-12 提交的版本。查看 最新版本

// ==UserScript==
// @name         bilibili直播精简
// @namespace    https://coding.net/u/BackRunner/p/GreaseMonkey-JS/git
// @version      1.1.3
// @description  精简了bilibili的直播页面
// @author       BackRunner
// @match        *://live.bilibili.com/*
// @license      MIT
// @grant        unsafeWindow
// ==/UserScript==

// ==   Tips   ==
// 使用时可以根据自己需要用双斜线注释掉部分代码开启你想要的功能(比如送礼)
// 建议临时开启部分功能不要更改下面的代码,请临时禁用这个脚本
// 注释掉部分代码可能会影响整体美观
// == 更新日志 ==
// 2016.11.12 - 1.1.3
// 更新一个对星域通知的精简
// 2016.10.29 - 1.1.2
// 直播主页不执行脚本,以修复顶栏css异常问题
// 2016.10.28 - 1.1.1
// 修复了一个Greasemonkey的兼容问题
// ==============


(function() {
    if (window.location.href == "http://live.bilibili.com/"){
        console.warn('Bilibili直播页面精简脚本 by BackRunner: 目前在主页,不执行脚本');
    } else {
        console.warn('Bilibili直播页面精简脚本 by BackRunner: 脚本运行');
        //变量定义
        var cssText = "";

        //去广告Banner
        $('div').remove('.live-ad-full');
        //去顶部下载
        $('div').remove('.download-link.p-relative.float-left');
        //去除排行榜
        $('div').remove('.rank-list-ctnr');
        //去除礼物连击
        $('div').remove('.super-gift-ctnr');
        //去除左边栏
        $('#room-left-sidebar').remove();

        //背景调整
        $('.bk-img').css({'transform':'translate(0,0)','-webkit-transform':'translate(0,0)'});
        //主体位置调整
        $('.room-main-ctnr').css({'transform':'translate(0,0)','-webkit-transform':'translate(0,0)'});
        //去除聊天框低于1000礼物提示
        $('div').remove('.gift-msg-1000.p-absolute');
        //去除礼物面板
        $('div').remove('.gift-panel.main-section');
        //聊天面板css调整
        $('#chat-ctrl-panel.chat-ctrl-panel').css('padding','20px 10px 23px 10px');
        //弹幕字数限制提示css调整
        $('.danmu-length-count').css('top','22px');
        //聊天发送框css调整
        $('.danmu-textbox.float-left').css('height','65px');
        $('.danmu-send-btn.float-right.live-btn.default').css('height','85px');
        //移除银瓜子宝箱
        $('div').remove('.treasure-box-ctnr.treasure');
        //移除我要直播
        $('div').remove('.live-action-btn-ctnr');
        //移除整个footer
        $('div').remove('.live-footer.p-relative');
        //移除播主信息中的礼物信息
        $('div').remove('.row-item');
        $('div').remove('.activity-top-panel.dp-inline-block');
        //聊天发送框下排3个按钮
        $('div').remove('.profile-ctrl');
        //去聊天框内用户等级信息、VIP标志、等级信息等等

        //红叶祭活动标志
        cssText += '#chat-msg-list a[href="/hd/aki2016"] {display: none !important;}';
        //用户vip标志
        cssText += '#chat-msg-list a[href="/i#to-vip"] {display: none !important;}';
        //奖牌标志
        cssText += '#chat-msg-list .medal-icon {display: none !important;}';
        //用户等级标志
        cssText += '#chat-msg-list .user-level-icon {display: none !important;}';
        //称号标志
        cssText += '#chat-msg-list a[href="/i/myTitle#list"] {display: none !important;}';
        //礼物信息
        cssText += '#chat-msg-list .gift-msg {display: none !important;} #chat-list-ctnr > .super-gift-ctnr, #gift-msg-1000 {display: none !important;} #chat-list-ctnr > #chat-msg-list {height: 100% !important;}';
        //聊天框内的各种公告(系统公告、小电视抽奖)
        cssText += '.announcement-container {display:none !important;}';
        //聊天框内的系统公告(xxx进入了直播间)
        cssText += '.system-msg {display:none !important;}';
        //星域通知
        cssText += '.universe-notice {display:none !important;}';
        
        //顶部css调整(如果错位请注释掉下面这个部分)
        cssText += '.search-bar-ctnr {padding-right:80px; !important}';
        cssText += '.user-avatar {padding-right:40px; !important}';
        $('#top-nav-msg-hinter').css('right','60px');

        var modStyle = document.querySelector('#modCSS');
        if (modStyle === null)
        {
            modStyle = document.createElement('style');
            modStyle.id = 'modCSS';
            document.body.appendChild(modStyle);
        }   
        modStyle.innerHTML = cssText;
    }
})();