csdn-clear-version

try to take over the world!

目前為 2018-05-14 提交的版本,檢視 最新版本

// ==UserScript==
// @name         csdn-clear-version
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       ppdesu
// @match        https://blog.csdn.net/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Your code here...
    var obj = document.querySelector("a#btn-readmore.btn.btn-red-hollow");
    if(obj!=null)
        obj.click();
    //clear the aside
    setTimeout(()=>{

        var lists = [
            "header",
            "aside",
            ".csdn-toolbar",
            ".recommend-box",
            ".pulllog-box",
            ".tool-box",
            ".unlogin-box",
            ".edu-promotion"
        ];

        for(var i=0;i<lists.length;i++)
        {
            var ele = document.querySelector(lists[i]);
            if(ele != null)
            {
                ele.parentNode.removeChild(ele);
            }
            else
            {
                console.log(lists[i] + "aside query failed!");
                return;
            }
        }

        setTimeout(()=>{
        var listsall = [
            "iframe",
            ".ad",
            ".ad-text",
            ".ad-img"
        ];
        for(i=0;i<listsall.length;i++)
        {
            ele = document.querySelectorAll(listsall[i]);
            //while(ele.length==1)
            //{
                for(var j=0;j<ele.length;j++)
                {
                    console.log("remove iframe"+j);
                    if(ele[j] != null)
                    {
                        ele[j].parentNode.removeChild(ele[j]);
                    }
                }
                //ele = document.querySelectorAll(listsall[i]);
            //}
        }
        },2000);
        //alert("executed!");
    },100);
})();

QingJ © 2025

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