CSDN,stackoverflow 清爽阅读

try to take over the world!

当前为 2018-04-16 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         CSDN,stackoverflow 清爽阅读
// @namespace    http://tampermonkey.net/
// @version      0.1.2
// @description  try to take over the world!
// @author       You
// @match        https://blog.csdn.net/*
// @match        https://stackoverflow.com/questions/*
// @grant        none
//  2018-04-16 增加Statckoverflow站点
// ==/UserScript==

(function() {
    'use strict';


    function del(id){ try{$(id).remove(); }catch(e){}}
    function css(id,styles){ try{ $('#'+id).css(styles);}catch(e){} try{ $(id).css(styles);}catch(e){}}

    function killCSDN(){
        del('#side,#navigator,#article_ad');
        css('main',{ paddingLeft : 0, width: '97%',float : 'left'});
        css('article_content',{height:'auto'});
        del('.readall_box,.article_next_prev,aside');

        setTimeout(function(){
           del('#share_box,.meau-gotop-box,.csdn-toolbar,.recommend_list,.comment_look_more');
           css('comment_list',{height:'auto'});
           del('.pulllog-box');//讨厌的注册条
           del('.comments');//无用的注册条
           del('iframe');
       },900);
    }

    /* StatckOverflow 站点 */
    function killStackoverflow(){
        $('#sidebar').remove();
        setTimeout(function(){
            $('#mainbar, .mainbar').css({'width':'97%'});
            $('.answer').css({'width':'97%'});
            $('.answers-header').css({'width':'97%'});
            $('#questions, #answers').css({'width':'97%'});
            $('.everyonelovesstackoverflow').remove();

            $('footer').remove();
            $('#dfp-mlb').remove();
            $('.new-post-login').hide();
            $('#post-form').hide();
            $('.question-page #answers .answer').css({'border-top':'5px solid #ccc'});

            $('.bottom-notice').remove();
            $('.hero-container').remove();
            $('.post-text ~ div').remove();

            $('.answer .vote-count-post:contains("-")').each(function(){
                $(this).parents('.answer').remove();
            });
        },1000);
    }

    var host = window.location.host;


    if( 'blog.csdn.net' == host){
       killCSDN();
    }else if('stackoverflow.com' == host){
       killStackoverflow();
    }

   
    // Your code here...
})();