Greasy Fork

Greasy Fork is available in English.

CSDN去广告

try to take over the world!

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         CSDN去广告
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  try to take over the world!
// @author       nanfang
// @match        *://blog.csdn.net/*/article/details/*
// @match        *://*.blog.csdn.net/article/details/*
// @match        *://bbs.csdn.net/topics/*
// @match        *://*.iteye.com/blog/*
// @grant        none
// @icon         https://csdnimg.cn/public/favicon.ico
// @run-at       document-end
// ==/UserScript==

(function() {
    'use strict';
    // Your code here...
    var myRemove=function(element){
        if(element){
           element.remove();
        }
    }
    var removeClassList=function(name){
        var list=document.getElementsByClassName(name);
        var length=list.length;
        for(let i=0;i<length;i++){
            list[0].remove();
            //list[0].parentNode.removeChild(list[0]);
        }
    }
    $(document).ready(function(){
        var advertising=document.getElementsByClassName("csdn-tracking-statistics mb8 box-shadow")[0];
        console.log(advertising);
        myRemove(advertising);
        var footer=document.getElementById("asideFooter").children[0];
        myRemove(footer);
        var footer_2=document.getElementById("dmp_ad_58").children[0];
        myRemove(footer_2);
        removeClassList("recommend-item-box recommend-recommend-box")
        removeClassList("recommend-item-box blog-expert-recommend-box");
    });
})();