精简常见文章网站

精简 CSDN、简书、蒲公英、脚本之家、知乎专栏、百家号

目前为 2023-02-07 提交的版本。查看 最新版本

// ==UserScript==
// @name         精简常见文章网站
// @namespace    http://tampermonkey.net/
// @license      GPL-3.0
// @version      1.1
// @description  精简 CSDN、简书、蒲公英、脚本之家、知乎专栏、百家号
// @author       AiniyoMua
// @home-url     https://gf.qytechs.cn/zh-CN/scripts/459519
// @homepageURL  https://gf.qytechs.cn/zh-CN/scripts/459519
// @supportURL   https://gf.qytechs.cn/zh-CN/scripts/459519/feedback
// @match        *://blog.csdn.net/*
// @match        *://www.csdn.net/*
// @match        *://www.jianshu.com/p/*
// @match        *://events.jianshu.io/p/*
// @match        *://www.jb51.net/article/*
// @match        *://www.jb51.net/softjc/*
// @match        *://www.jb51.net/news/*
// @match        *://dandelioncloud.cn/article/*
// @match        *://www.dandelioncloud.cn/article/*
// @match        *://demo.dandelioncloud.cn/article/*
// @match        *://zhuanlan.zhihu.com/p/*
// @match        *://baijiahao.baidu.com/s*
// @icon         data:image/png;base64,UklGRkIAAABXRUJQVlA4WAoAAAAQAAAABAAABAAAQUxQSAQAAAABiIgIVlA4IBgAAAAwAQCdASoFAAUAAwBQJaQAA3AA/valAAA=
// @grant        GM_addStyle
// @run-at       document-body
// ==/UserScript==
// ██ 注意 注意 ██:在本脚本 设置>通用>运行时期 里选择 document-body 以获得无感知脚本加载体验
// ██ 注意 注意 ██:在本脚本 设置>通用>运行时期 里选择 document-body 以获得无感知脚本加载体验
(function() {
	if(window.location.hostname.includes("csdn")){
		csdn();
	}else if(window.location.hostname.includes("jianshu")){
		jianshu();
	}else if(window.location.hostname.includes("jb51")){
		jiaoben();
	}else if(window.location.hostname.includes("dandelioncloud")){
		pugongying();
	}else if(window.location.hostname.includes("zhihu")){
		zhihu();
	}else if(window.location.hostname.includes("baijiahao")){
		baijiahao();
	}


	function csdn() {
		const css1 = `
			#tool-QRcode{display:none !important;}
			.blog_container_aside{display:none !important;}
			.programmer1Box{display:none !important;}
			.recommendAdBox{display:none !important;}
			#recommendAdBox{display:none !important;}
			#csdn-toolbar{display:none !important;}
			#recommendNps{display:none !important;}
			#asideArchive{display:none !important;}
			.hot-brand{display:none !important;}
			.top-banner{display:none !important;}
			.pudn-recommend{display:none !important;}
			#wrapper{display:none !important;}
			#mys-wrapper{display:none !important;}
			.csdn-side-toolbar{display:none !important;}
			.aside-box.kind_person.d-flex.flex-column{display:none !important;}
			.blog-content-box{box-shadow: 0 16px 45px rgb(0 0 0 / 15%) !important;}
			.content-list{box-shadow: 0 16px 16px rgb(0 0 0 / 3%) !important;}
			.left-toolbox{padding-top: 0px !important;padding-bottom: 0px !important;height: 32px !important;}
			body{background-image: none !important;}
		`;
		let css2 = `
			body{background-image: none !important;}
		`;

		GM_addStyle(css1);
		window.onload = function(){GM_addStyle(css2);};
	}

	function jianshu() {
		const css1 = `
			iframe{display:none !important;}
			header{display:none !important;}
			.-umr26{display:none !important;}
			ins{display:none !important;}
			#mv_ad_render{display:none !important;}
			aside > div{display:none !important;}
			._1pUUKr{display:none}
			._gp-ck{width:900px !important;box-shadow: 0 16px 45px rgb(0 0 0 / 15%) !important;}
			._1Jdfvb{padding:0 0 0 0 !important;}
			._13lIbp{display:none !important;}
		`;
		// 嵌入式广告
		// 头部
		// 广告
		// 底下文章推荐间广告
		// 一样
		// 右侧栏文章推荐,
		// 左边三个悬浮按钮
		// 主题文章,增加宽度,增加阴影
		// 底边栏,点赞评论栏,更改padd
		// 文章底部赞赏 div
		GM_addStyle(css1);
	}

	function jiaoben() {
		const css = `
			#topbar{display: none !important;}
			#header{display: none !important;}
			#nav{display: none !important;}
			#submenu{display: none !important;}
			.pt10.clearfix{display: none !important;}
			.mys-wrapper{display: none !important;}
			#mys-wrapper{display: none !important;}
			#mys-content{display: none !important;}
			.main-right{display: none !important;}
			.main-left{width: 1000px !important;}
			#container{width: 1000px !important;}
			#right-share{display: none !important;}
			.lbd.clearfix{display: none !important;}
			.lbd_bot.clearfix{display: none !important;}
			.search{display: none !important;}
			.xgcomm.clearfix{display: none !important;}
			#ewm{display: none !important;}
			.breadcrumb{display: none !important;}
			.adsbygoogle{display: none !important;}
			#aswift_1_host{display: none !important;}
			#aswift_1{display: none !important;}
			#aswift_2_host{display: none !important;}
			#aswift_2{display: none !important;}
			#article{box-shadow: 0 16px 45px rgb(0 0 0 / 15%) !important;}
		`
		// 顶栏
		// 头部
		// 头部栏
		// 头部菜单
		// 头部 标签广告
		// 三个mys 没用,因为广告是重新document嵌入的
		// 右侧栏
		// 左边正文更改宽度
		// 正文父布局更改宽度
		// 左边的分享、一键回顶 悬浮栏
		// 文章主体 顶部的嵌入广告
		// 文章主体 底部的嵌入广告
		// 搜索栏
		// 底部 更多文章推荐
		// 关注脚本之家
		// 您的位置
		// 文章嵌入gg广告
		// 文章嵌入gg广告
		// 文章嵌入gg广告
		// 文章嵌入gg广告
		// 文章嵌入gg广告
		// 文章主体框添加阴影
		GM_addStyle(css);
	}

	function pugongying() {
		const css = `
			.menu-top{display: none !important;}
			#menu-aside{display: none !important;}
			.adsbygoogle{display: none !important;}
			.home.home-index{background-image: none !important;background: #F5F6F7 !important}
			.main.fl{width: 85% !important;}
			.single-entry p{color: #2b2b2b !important;}
			body{background: #dfdfdf !important;background-color: #dfdfdf !important;}
			#pjax_on{background: #dfdfdf !important;background-color: #dfdfdf !important;}
		`
		GM_addStyle(css);
	}

	function zhihu() {
		const css = `
			.Post-NormalMain > div, .Post-NormalMain > header{width:1000px !important;}
			.Post-RichTextContainer{padding: 24px !important;box-shadow: 0 16px 45px rgb(0 0 0 / 15%) !important;}
			.Post-NormalSub > div{width:1000px !important;}
			div.AuthorInfo{max-width: 900px !important;}
			.Post-SideActions{display: none !important;}
			div.ColumnPageHeader-content{height:30px !important;}
			.Sticky.is-fixed {height:30px !important;}
			div.ColumnPageHeader{height:30px !important;}
			div.ColumnPageHeader-content > a > svg {height:30 !important;}
			button.ColumnPageHeader-WriteButton {line-height: 28px !important;}

		`
		// 更改文章主体 宽度
		// 给文章主体添加阴影,与padding
		// 更改评论区的宽度
		// 更改标题关注按钮的距离
		// 去掉右边悬浮按钮 点赞分享
		// 更改顶栏高度
		// 更改顶栏高度
		// 更改顶栏高度
		// 更改顶栏元素高度
		// 更改顶栏元素高度

		GM_addStyle(css);
		window.onload = function(){document.querySelector("div.ColumnPageHeader-content > a > svg").setAttribute('height', 24);};
		// 更改顶栏logo元素高度
	}
	function baijiahao() {
		const css = `
			#ssr-content > div:nth-child(2) > div:nth-child(1) > div:nth-child(2){display: none !important;}
			#ssr-content > div:nth-child(2) > div:nth-child(1) > div:nth-child(1){width:100% !important;}
			#ssr-content > div:nth-child(2) > div:nth-child(1){width:1000px !important;padding: 24px !important;box-shadow: 0 16px 45px rgb(0 0 0 / 15%) !important;}
			#ssr-content > div:nth-child(2){padding-top: 8px !important;}
			#ssr-content > div:nth-child(1){position: static !important;}
		`
		// 去掉右边栏
		// 文章 匹配父布局宽度
		// 文章主题更改宽度,添加阴影
		// 顶栏去掉悬浮

		//#ssr-content > div:nth-child(1){height:36px !important;position: static !important;}
		//#ssr-content > div:nth-child(1) > div:nth-child(1) > div{height:36px !important;}
		//#ssr-content > div:nth-child(1) > div:nth-child(1) > div:nth-child(1) > form{display: none !important;}
		GM_addStyle(css);
	}

})();

QingJ © 2025

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