删除主页广告、邀请、垃圾内容
当前为
// ==UserScript==
// @icon https://edu-wenku.bdimg.com/v1/na/0807/%E6%96%87%E5%BA%93APPicon-1603434254133.png
// @name 百度文库-精简&优化
// @namespace taozhiyu.gitee.io
// @version 0.2.2
// @description 删除主页广告、邀请、垃圾内容
// @author 涛之雨
// @home-url https://greasyfork.org/zh-CN/scripts/422847
// @match *://wenku.baidu.com/*
// @grant GM_addStyle
// @license GPL-3.0-only
// ==/UserScript==
/**********************************************\
* V 0.2.2
* 添加GPL-3.0-only协议
* V 0.2.1
* 锁定隐藏首页“邀请好友”banner
* 实现免VIP全屏阅读
* 全局滚动条美化
* 修改文库页面的图标
* 重构去除广告代码
* 屏蔽文章末尾的结束提示(因为会遮盖部分界面)
* 自动加载全部页面
* 移除主题按钮
* V 0.1.1
* 初版,删除精简大部分垃圾、广告等
* TODO : 实现免VIP全屏阅读
* TODO : 免VIP复制等
\************************************************/
(function() {
'use strict';
const changeFavicon = link => {
let $favicon = document.querySelector('link[rel="shortcut icon"]');
let $favicon1 = document.querySelector('link[rel="icon"]');
$favicon?$favicon.href = link:""
$favicon1?$favicon1.href = link:""
if(!($favicon||$favicon1)){
$favicon = document.createElement("link");
$favicon.rel = "icon";
$favicon.href = link;
document.head.appendChild($favicon);
}
};
//修改logo
changeFavicon("https://edu-wenku.bdimg.com/v1/na/0807/%E6%96%87%E5%BA%93APPicon-1603434254133.png");
GM_addStyle(`
.theme-wap,
.experience-card-wrap,
.convert-btn-point,
.try-end-fold-page,
.bottom-pop-wrap,
.pure-guide-dialog,
.vip-card-wrap,
.vip-pop-wrap,
.inner-vip,
.hx-bottom-wrapper,
.hx-recom-wrapper,
.qr-wrapper,
.feedback-wrapper,
.hx-right-wrapper.sider-edge,
.app-btn,
.hx-warp,
.client-btn-wrap,
.relative-doc-ad-wrapper,
.red-point,
.tips,
.ex-wrapper,
.vip-activity-wrap-new,
.bz-doc-tool-dialog-fix,
.fixed-activity-bar,
.doc-tool-dialog-wrapper{
display:none!important;
width:0!important;
overflow:hidden!important;
}
.operation-wrapper{
display:none;
}
.bg-items-wrapper{
margin-left:0!important;
}
body{
overflow-y: scroll!important;
}
::-webkit-scrollbar-track{
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
border-radius: 10px;background-color: #F5F5F5;
}
::-webkit-scrollbar{
width: 8px;
background-color: #F5F5F5;
}
::-webkit-scrollbar-thumb{
border-radius: 10px;
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,.3);
background-color: #c1c1c1;
}
`)
document.querySelector(".red-dot").classList.remove("red-dot")
document.querySelector(".full-screen").classList.add("pure-tool-btn")
let o=false
window.onscroll=()=>{
if(o){return}
let s=document.body.scrollTop || document.documentElement.scrollTop;
if(0 < document.querySelector(".read-all").offsetTop - s&&
document.querySelector(".read-all").offsetTop - s< window.innerHeight){
document.querySelector(".read-all").click()
o=true;
}
}
})();