CSDN 简化

去除 CSDN 博客多余杂项,保持页面简洁

Version vom 14.06.2023. Aktuellste Version

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

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

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

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

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

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

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.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         CSDN 简化
// @namespace    https://huanfei.top/
// @version      0.0.1
// @description  去除 CSDN 博客多余杂项,保持页面简洁
// @author       huanfei
// @match        *://blog.csdn.net/*
// @icon         https://www.csdn.net/favicon.ico
// @grant        GM_addStyle
// @license      MIT License
// @run-at       document-start
// ==/UserScript==

(function () {
    const style = [
        'aside.blog_container_aside{display:none}',
        'main{width:100%}',
        '#mainBox{width:70%}',
        '.recommend-box{display:none}',
        '#recommendNps{display:none !important}',
        '.option-box[data-type="guide"]{display:none !important}',
        '.option-box[data-type="cs"]{display:none !important}',
        '.hide-article-box.hide-article-pos{display:none !important}}'
    ];
    GM_addStyle(style.join(''));
    document.onreadystatechange = () => {
        document.querySelector('.option-box[data-type="gotop"]').remove();
        const top = document.createElement('a');
        top.addEventListener('click', () => {
            window.scrollTo({ left: 0, top: 0 });
        });
        top.className = 'option-box';
        top.innerHTML = `<img src="https://g.csdnimg.cn/side-toolbar/3.4/images/fanhuidingbucopy.png" alt="" srcset="">
            <span class="show-txt">返回<br>顶部</span>`;
        document.querySelector('.csdn-side-toolbar ').appendChild(top);
    };
})();