简化 CSDN Blog 详情 - Fuck CSDN Blog

简化 CSDN 博客详情页面,免登录复制

За да инсталирате този скрипт, трябва да имате инсталирано разширение като Tampermonkey, Greasemonkey или Violentmonkey.

За да инсталирате този скрипт, трябва да инсталирате разширение, като например Tampermonkey .

За да инсталирате този скрипт, трябва да имате инсталирано разширение като Tampermonkey или Violentmonkey.

За да инсталирате този скрипт, трябва да имате инсталирано разширение като Tampermonkey или Userscripts.

За да инсталирате скрипта, трябва да инсталирате разширение като Tampermonkey.

За да инсталирате този скрипт, трябва да имате инсталиран скриптов мениджър.

(Вече имам скриптов мениджър, искам да го инсталирам!)

За да инсталирате този стил, трябва да инсталирате разширение като Stylus.

За да инсталирате този стил, трябва да инсталирате разширение като Stylus.

За да инсталирате този стил, трябва да инсталирате разширение като Stylus.

За да инсталирате този стил, трябва да имате инсталиран мениджър на потребителски стилове.

За да инсталирате този стил, трябва да имате инсталиран мениджър на потребителски стилове.

За да инсталирате този стил, трябва да имате инсталиран мениджър на потребителски стилове.

(Вече имам инсталиран мениджър на стиловете, искам да го инсталирам!)

// ==UserScript==
// @name         简化 CSDN Blog 详情 - Fuck CSDN Blog
// @namespace    github.com/yuunie
// @version      1.2
// @description  简化 CSDN 博客详情页面,免登录复制
// @author       [email protected]
// @license      MIT
// @match        *://blog.csdn.net/*
// @icon         https://img-home.csdnimg.cn/images/20201124032511.png
// @grant        GM_addStyle
// @grabt        PRO_addStyle
// @grabt        addStyle
// @grant        window.onurlchange
// @run-at       document-start
// ==/UserScript==

function addCss(css) {
    if (typeof GM_addStyle != "undefined") {
        GM_addStyle(css);
    } else if (typeof PRO_addStyle != "undefined") {
        PRO_addStyle(css);
    } else if (typeof addStyle != "undefined") {
        addStyle(css);
    } else {
        var node = document.createElement("style");
        node.type = "text/css";
        node.appendChild(document.createTextNode(css));
        var heads = document.getElementsByTagName("head");
        if (heads.length > 0) {
            heads[0].appendChild(node);
        } else {
            // no head yet, stick it whereever
            document.documentElement.appendChild(node);
        }
    }
}

function runCss() {
    const css = `
body {
background: #f5f6f7!important;
}
#csdn-toolbar {

}
.toolbar-menus.csdn-toolbar-fl {
display:none!important;
}
.toolbar-container-middle {
display:none!important;
}
.toolbar-btn.toolbar-btn-vip {
display:none!important;
}
.toolbar-btn.toolbar-btn-dynamic.toolbar-mp-menubox {
display:none!important;
}
#toolBarBox .left-toolbox {
display:none!important;
}
.recommend-box.insert-baidu-box.recommend-box-style {
display:none!important;
}
#recommendNps {
display:none!important;
}
#blogColumnPayAdvert {
display:none!important;
}
.icon-option-beta{
display:none!important;
}
.blog_container_aside {
display: none!important;
}
main {
float: none!important;
margin-left: auto!important;
margin-right: auto!important;
}
#content_views pre {
    -webkit-touch-callout: initial!important;
    -webkit-user-select: initial!important;
    -khtml-user-select: initial!important;
    -moz-user-select: initial!important;
    -ms-user-select: initial!important;
    user-select: initial!important;
}
#content_views pre code {
    -webkit-touch-callout: initial!important;
    -webkit-user-select: initial!important;
    -khtml-user-select: initial!important;
    -moz-user-select: initial!important;
    -ms-user-select: initial!important;
    user-select: initial!important;
}
.hljs-button.signin {
display:none!important;
}
#csdn-toolbar .toolbar-container, #csdn_tool_otherPlace .toolbar-container {
min-width: 1000px!important;
max-width: 1000px!important;
}
.toolbar-btn.toolbar-btn-write > a > i {
display:none!important;
}
.option-box.sidecolumn {
display:none!important;
}
    `
    // 添加样式
    addCss(css)
}

function runJs() {
    $('.option-box.sidecolumn.sidecolumn-hide').click()
    const interval = setInterval(() => {
        $('.option-box.sidecolumn.sidecolumn-hide').click()
    }, 100)
    setTimeout(() => {
        clearInterval(interval)
    }, 2000)
}


(function () {
    'use strict';
    runCss()
    window.onload = function () {
        runCss()
        runJs()
    }
})();