csdn 极简版

csdn 页面极端简化版, 只显示正文.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey 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 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 极简版
// @namespace    http://tampermonkey.net/
// @version      0.0.1
// @description  csdn 页面极端简化版, 只显示正文.
// @author       kgzhang
// @match        https://blog.csdn.net/*/article/details/*
// @grant        GM_addStyle
// ==/UserScript==

// 有时会渲染失败,影响后面的执行
try{
    GM_addStyle('.recommend-right_aside {display:none}');
    GM_addStyle('.tool-box {display:none}');
    GM_addStyle('.csdn-side-toolbar {display:none}');
    GM_addStyle('.blog_container_aside {display:none}');
    GM_addStyle('.csdn-toolbar {display:none}');
    GM_addStyle('.csdn-toolbar {display:none}');
    GM_addStyle('.container#mainBox main {width: unset 1000px}');
    GM_addStyle('.blog-content-box{width: 1200px; margin-left: -200px;}')
    // 屏蔽评论框
    GM_addStyle('.comment-box{display: none;}')
    // 屏蔽推荐
    GM_addStyle('.recommend-box{display: none;}')
    GM_addStyle('.template-box{display: none;}')
} catch (e){

}



(function() {
    'use strict';

    // Your code here...
    window.onload = ()=> {
        window.localstorage.setItem('anonymousUserLimit','');
        const box = document.getElementById('passportbox');
        if (box) {
            box.style.display = 'none';
        }
        const blog = document.querySelector('.blog-content-box');
        if (blog) {
            blog.parentNode.children[4].style.display = 'none';
        }
    }
    window.addEventListener('scroll', ()=>{
        // 阅读更多
        const got = document.querySelector('a[class="btn-readmore"]')
        if (got) {
            got.click();
        }
    })
    // 定期检查广告弹框
    setInterval(()=>{
        const blog = document.querySelector('.blog-content-box');
        if (blog && blog.parentElement.children[4].tagName === 'DIV') {
            blog.parentElement.children[4].style.display = 'none';
        }
    }, 200);
})();