Csdn Ads Cleaner

Clear those fxxking ads on csdn!

12.01.2019 itibariyledir. En son verisyonu görün.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         Csdn Ads Cleaner
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description: zh
// @description: en
// @description  Clear those fxxking ads on csdn!
// @author       sun123zxy
// @match        blog.csdn.net/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    
    var CAB = document.createElement("button");
    CAB.innerHTML="Clear Ads";
    //CAB.setAttribute("onclick", "javascript:ClearAds()");

    CAB.onclick=function(){
        console.log("Finding ads...");
        var Ads = new Array(document.getElementsByClassName("csdn-tracking-statistics mb8 box-shadow")[0],
                            document.getElementsByClassName("fourth_column")[0],
                            document.getElementsByClassName("right-item _paradigm_S8_csdn_ads_render")[0],
                            document.getElementById("kp_box_57"),
                            document.getElementsByClassName("right-item _paradigm_S27_csdn_ads_render")[0],
                            document.getElementsByClassName("pulllog-box")[0],
                            document.getElementById("adContent")
                           );
        console.log("Clearing ads...");
        for(var i=0;i<Ads.length;i++){
            if(Ads[i]){
               Ads[i].parentNode.removeChild(Ads[i]);
            }
        }
        console.log("Sucessfully Clear Ads!");
    }
    var body= document.body;
    body.insertBefore(CAB,document.getElementsByClassName("container clearfix")[0]);
    console.log("Sucessfully spawn Clear Button...");
})();