Greasy Fork is available in English.

CSDN 净化

去除CSDN多余的广告侧边栏信息

Verze ze dne 24. 02. 2020. Zobrazit nejnovější verzi.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         CSDN 净化
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  去除CSDN多余的广告侧边栏信息
// @author       贺墨于
// @match        *://*.csdn.net/*
// @require      http://libs.baidu.com/jquery/2.0.0/jquery.min.js
// @grant        none
// ==/UserScript==

var gList = [];

$(function(){
    push('.aside-box');
    push('.recommend-box');
    push('.template-box');
    execHidden();
    fitContent();
})

function fitContent(){
    $('#mainBox main').css('cssText', 'width:100% !important');
    $('.tool-box.vertical').css('right', '33px');
    $('div.csdn-side-toolbar').css('right', '33px');
    $("a.btn-readmore").trigger("click");
}

function execHidden(){
    for(var i = 0; i < gList.length; i++){
        hidden(gList[i]);
    }
}

function push(content){
    gList.push(content);
}

function log(msg){
    console.log(msg);
}

function hidden(obj){
    if(typeof(obj)=== 'string'){
        obj = $(obj);
    }
    obj.css('display', 'none')
}