FUCK UGLY

干掉那些恶心的东西

当前为 2019-03-01 提交的版本,查看 最新版本

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

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

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

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

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         FUCK UGLY
// @namespace    http://www.dengquan.top
// @version      0.2
// @description  干掉那些恶心的东西
// @author       quan
// @match        https://blog.csdn.net/*/*/*/*
// @match        https://bbs.csdn.net/*/*
// @match        https://www.so.com/*
// @match        https://www.zhihu.com/*
// @match        https://www.jianshu.com/p/*
// @match        https://www.huya.com/*
// @grant        none
// @require      http://code.jquery.com/jquery-1.7.2.min.js
// ==/UserScript==

const site = window.location.href;
const csdnbbs = /bbs.csdn.net/
const csdnblog = /blog.csdn.net/
const so = /so.com/
const zhihu = /zhihu.com/
const jianshu = /jianshu.com/
const huya = /huya.com/

if(csdnblog.test(site)){//博客页面
    //去除展开登陆注册需求
    document.getElementById('article_content').style.height='';
    //去除展开按钮
    document.getElementsByClassName('hide-article-box')[0].style.display='none';
    //去除底部登陆注册提示
    document.getElementsByClassName('pulllog-box')[0].style.display='none';
    //去除页面中部广告
    document.getElementsByClassName('mediav_ad')[0].style.display='none';
    //去除谷歌广告
    document.getElementsByClassName('adsbygoogle')[0].style.display='none';
    //去除页面左侧侧栏广告
    document.getElementsByClassName('fourth_column')[0].style.display='none';
}else if(csdnbbs.test(site)){//论坛页面
    //模拟点击查看全部按钮
    document.getElementsByClassName('show_topic js_show_topic')[0].click();
}else if(so.test(site)){//360搜索
    //去掉右边广告推荐
    document.getElementById('side_wrap').style.display='none';
}else if(zhihu.test(site)){//知乎首页
    document.getElementsByClassName('Footer')[0].style.display='none';
    //去掉右边广告推荐
    document.getElementsByClassName('GlobalSideBar-categoryList')[0].style.display='none';

}else if(jianshu.test(site)){//简书
    document.getElementById('web-note-ad-fixed').style.display='none';
    document.getElementById('web-note-ad-1').style.display='none';
}else if(huya.test(site)){//虎牙
    //免登陆超清
    let nowIbitrate;
    const takeNowIbitrate=(notRecord)=> {
        if (document.querySelector("li[ibitrate='500']") !== null) {
            nowIbitrate = $('ul.player-videotype-list > li.on');
            changeEventRate(notRecord);
            return;
        }
        else {
            setTimeout(function () {
                takeNowIbitrate();
            }, 500);
        }
    }
    const autoChange=()=> {
        setTimeout(() => {
            if (document.querySelector('#player-login-tip-wrap') != null) {
                $('#player-login-tip-wrap').remove();
                changeRate();
                takeNowIbitrate(true);
                changeEventLine();
                return;
            }
            else {
                autoChange();
            }
        }, 500);
    }
    const changeEventRate=(notRecord)=> {
        $(".player-videotype-list li").click(function (e) {
            nowIbitrate = $(this);
            if (notRecord) {
                changeRate();
            }
        });
    }
    const changeEventLine=()=> {
        $('.player-videoline-list li').on('click', () => {
            vplayer.vcore.reqBitRate(nowIbitrate.attr("iBitRate"), true);
            changeEventRate(true);
        })
    }
    const changeRate=()=> {
        vplayer.vcore.reqBitRate(nowIbitrate.attr("iBitRate"), true);
        $('ul.player-videotype-list > li.on').removeClass('on');
        nowIbitrate.addClass('on');
        $('span.player-videotype-cur').text(nowIbitrate.text());
    }
    takeNowIbitrate(false);
    setTimeout(() => {
        autoChange();
    }, 301e3);

    //去广告
    //document.getElementById('huya-ad').style.display='none';

    //开启全屏关闭弹幕
    const clickLivePlatform=(danmu, fullscreen)=> {
        if (document.getElementById(danmu) != null) {
            document.getElementById(danmu).click();
        }
        if (document.getElementById(fullscreen) != null) {
            //document.getElementById(fullscreen).click();
        }
    }
    const applyLivePlatform=()=> {
        //document.getElementById('player-ctrl-wrap').style.display='inline';
        clickLivePlatform("player-danmu-btn", "player-fullscreen-btn")
        //document.getElementById('player-ctrl-wrap').style.display='block';
    }
    setTimeout(applyLivePlatform,1000);

}