CSDN,stackoverflow 清爽阅读

try to take over the world!

目前为 2018-04-16 提交的版本。查看 最新版本

// ==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...
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址