csdn页面阅读优化

对于blog.csdn.net网站上的文章,进行阅读优化,使阅读体验更好。包括隐藏网页头部导航,日历之类的模块,仅留下文章和评论部分。

目前为 2021-11-29 提交的版本。查看 最新版本

// ==UserScript==
// @name         csdn页面阅读优化
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  对于blog.csdn.net网站上的文章,进行阅读优化,使阅读体验更好。包括隐藏网页头部导航,日历之类的模块,仅留下文章和评论部分。
// @author       You
// @match        *://*.csdn.net/*
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// @license MIT
// ==/UserScript==
    var css = [
".blog_container_aside {",
"    display: none;",
"}",
".recommend-box {",
"    display: none;",
"}",
".csdn-side-toolbar {",
"    display: none;",
"}",
"#rightAside {",
"    display: none;",
"}",
"#csdn-toolbar {",
"    display: none;",
"}",
"pre:hover .hljs-button{",
"    display: none;",
"}",
".nodata .container main {",
"    width: 100%;",
        "max-width:100%;",
"}",
        "#mainBox{margin-left:0rem;}"
    ].join("\n");
lsAddStyle(css);
(function() {
    'use strict';

    // Your code here...
    $("#csdn-toolbar").remove();
})();

function lsAddStyle(css){
	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);
	}
}

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址