分享一段让你的csdn更好用的油猴脚本~

暗色主题+复制破解+界面精简+免登录读关注才能阅读的文章+代码自动展开(此项不需要请删除47-53)+...

持续维护……

// ==UserScript==
// @name         csdn++
// @namespace    https://expector-hutch.github.io//
// @version      0.1
// @description  美化csdn
// @author       Expector
// @match        https://blog.csdn.net/*
// @icon         https://g.csdnimg.cn/static/logo/favicon32.ico
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    console.log('csdn++开始加载……');
    try{document.getElementById('csdn-toolbar').remove();}catch{}
    try{document.getElementById('toolBarBox').remove();}catch{}
    try{document.getElementById('treeSkill').remove();}catch{}
    try{document.getElementById('recommendNps').remove();}catch{}
    try{document.getElementById('asideSearchArticle').remove();}catch{}
    try{document.getElementById('asideHotArticle').remove();}catch{}
    try{document.getElementById('asideNewComments').remove();}catch{}
    try{document.getElementById('asideNewNps').remove();}catch{}
    try{document.getElementById('asideArchive').remove();}catch{}
    try{document.getElementById('asideCategory').remove();}catch{}
    try{document.getElementById('blogColumnPayAdvert').remove();}catch{}
    try{document.getElementById('blogExtensionBox').remove();}catch{}
    try{document.getElementById('articleSearchTip').remove();}catch{}
    try{document.getElementById('article_content').style.height = 'auto';}catch{}
    try{document.getElementById('content_views').id = 'content_view';}catch{}
    try{document.getElementsByClassName("csdn-side-toolbar")[0].remove();}catch{}
    try{document.getElementsByClassName("article-info-box")[0].remove();}catch{}
    try{document.getElementsByClassName("blog-footer-bottom")[0].remove();}catch{}
    try{document.getElementsByClassName("template-box")[0].remove();}catch{}
    try{document.getElementsByClassName("profile-intro-name-boxOpration")[0].remove();}catch{}
    try{document.getElementsByClassName("aside-box-footer")[0].remove();}catch{}
    try{document.getElementsByClassName("hide-article-box")[0].remove();}catch{}
    try{var rb = document.getElementsByClassName("recommend-box");
        for (var a = 0; a < rb.length; a+1){
            rb[a].remove();
        }
    }catch{}
    try{var sn = document.getElementsByClassName("signin");
        for (var b = 0; b < sn.length; b+1){
            sn[b].remove();
        }
    }catch{}
    try{var sc = document.getElementsByClassName("set-code-hide");
        var pb = document.getElementsByClassName("hide-preCode-box");
        for (var c = 0; c < sc.length; c+1){
            sc[c].classList.remove('set-code-hide');
            pb[c].remove();
        }
    }catch{}
    try{
        var dark_style = document.createElement('link');
        dark_style.rel = "stylesheet";
        dark_style.type = "text/css";
        dark_style.href = "https://csdnimg.cn/release/blogv2/dist/pc/themesSkin/skin-eyes/skin-eyes-b8f3b55f4e.min.css";
        document.getElementsByTagName('head')[0].appendChild(dark_style);
    }catch{}
    console.log('csdn++加载完毕!');
})();
115 views
Comments
登录后评论
Sign In
·

csdn纯净版 joy

·

+1 感谢大佬分享

·

try catch是这么用的吗 fearful