Clean CSDN Blog

净化CSDN,优化阅读体验

20.11.2021 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         Clean CSDN Blog
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  净化CSDN,优化阅读体验
// @author       fengxxc
// @match        https://blog.csdn.net/*
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';
    // 干掉下边登录条
    var pulllogbox = document.getElementsByClassName('pulllog-box');
    if(pulllogbox.length > 0) {
        pulllogbox[0].style.display = 'none';
    }
    // 阅读更多
    function triggerClick(dom){
        //IE
        if(document.all) {
            dom.click();
        }
        // 其它浏览器
        else {
            var e = document.createEvent("MouseEvents");
            e.initEvent("click", true, true);
            dom.dispatchEvent(e);
        }
    }
    var btnReadmore = document.getElementsByClassName('btn-readmore')[0];
    if (btnReadmore) {
        triggerClick(btnReadmore); // csdn blog
    }
    // 干掉左边
    document.getElementById('mainBox').getElementsByTagName('aside')[0].remove();
    //document.getElementById('mainBox').getElementsByTagName('aside')[0].style.transform = 'translate(-370px,0)'; // new
    // 干掉右边
    document.getElementsByClassName('recommend-right')[0].style.display = 'none';
    //document.getElementsByClassName('recommend-right')[0].style.transform = 'translate(370px,0)'; // new
    // 放大中间
    document.getElementById('mainBox').style.zIndex = '999';
    document.getElementById('mainBox').style.position = 'relative'; // new
    document.getElementById('mainBox').getElementsByTagName('main')[0].style.position = 'absolute'; // new
    document.getElementById('mainBox').getElementsByTagName('main')[0].style.width = '100%';
    // 干掉注册登录
    document.getElementById('passportbox').style.display = 'none';
    document.getElementsByClassName('login-mark')[0].style.display = 'none';

    // 干掉最上面的广告
    document.querySelector("#csdn-toolbar").remove();
})();