Greasy Fork is available in English.
去掉相关文档推荐和购买链接,免开会员使用VIP背景换肤
当前为
// ==UserScript==
// @name 百度文库去广告
// @namespace http://tampermonkey.net/
// @version 0.8
// @description 去掉相关文档推荐和购买链接,免开会员使用VIP背景换肤
// @author AN drew
// @match https://wenku.baidu.com/*
// @require https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js
// @require https://cdn.bootcdn.net/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js
// @grant GM_addStyle
// ==/UserScript==
(function() {
'use strict';
GM_addStyle(`html.full-screen::-webkit-scrollbar { width: 0 !important }
html.full-screen { -ms-overflow-style: none; }
html.full-screen { overflow: -moz-scrollbars-none; }
.btn.saveskin {height: 36px;
background: green;
text-align: center;
position: absolute;
right: 48px;
top: 15px;
border-radius: 6px;
font-family: PingFangSC-Medium,sans-serif;
font-size: 16px;
color: #fff;
display: inline-block;
line-height: 36px;
vertical-align: middle;
min-width: 100px;
cursor: pointer;}`);
if(window.location.href.indexOf("https://wenku.baidu.com/ndcore/browse/sub") > -1)
{
if(document.querySelector(".red-text.bold-text"))
document.querySelector(".red-text.bold-text").style.display="none";
if(document.querySelector(".pay-vip-btn-wrap"))
document.querySelector(".pay-vip-btn-wrap").style.display="none";
if(document.querySelector(".sub-right"))
document.querySelector(".sub-right").style.display="none";
if(document.querySelector(".sub-main"))
{
document.querySelector(".sub-main").style.cssText="display: flex; justify-content: center;";
/*
document.querySelector(".sub-main").style.display="flex";
document.querySelector(".sub-main").style.justifyContent="center";
*/
}
}
if (typeof $ != 'undefined')
{
//设置皮肤
if($.cookie('mytheme')==undefined)
{
$.cookie('mytheme', 'theme-1', { expires: 365, path: "/", domain: "wenku.baidu.com" });
}
else
{
$('#app').attr('class',$.cookie('mytheme'));
}
//保存皮肤
var $save = $('<div data-v-416af63d="" class="btn saveskin">保存皮肤</div>');
$save.click(function(){
if($('#app').attr('class')!=undefined)
{
$.cookie('mytheme', $('#app').attr('class'), { expires: 365, path: "/", domain: "wenku.baidu.com" });
}
//window.location.reload();
$('.bottom-theme-select-wrap').hide();
});
var timer1 = setInterval(()=>{
if($('.color-plate').length>0)
{
$('.color-plate').click(function(){
$('.bottom-theme-select-wrap').show();
let mytheme = $('#app').attr('class');
let serial = parseInt( mytheme.substring(mytheme.indexOf('-')+1) );
if(!$('.theme-item .bg-img').eq(serial-1).hasClass('selected'))
{
$('.theme-item .bg-img').removeClass('selected');
$('.theme-item .bg-img').eq(serial-1).addClass('selected');
}
});
clearInterval(timer1);
}
},1);
var timer2 = setInterval(()=>{
if($('.theme-list').length>0)
{
$('.theme-item .bg-img').click(function(){
$('.theme-item .bg-img').removeClass('selected');
$(this).addClass('selected');
});
clearInterval(timer2);
}
},1);
setInterval(()=>{
if($('.btn.saveskin').length==0)
{
$('.theme-list .title-wrap').append($save);
}
$('.theme-list .btn.join-vip').remove();
$('.bottom-theme-select-wrap > .btn-close').remove();
$('div.theme-list div.info').remove();
},1);
setInterval(()=>{
$('body').removeAttr('style');
},1);
setTimeout(function(){
$(".moreBtn.goBtn").click();
$(".read-all").click();
$(".more-coment").click();
if($(".moreBtn.goBtn").length>0)
{
setTimeout(function(){
$(window).scrollTop(0);
},500);
}
},1500);
setInterval(function(){
$('.fixed-activity-bar').hide();
$('.dialog-wraper').hide();
$('.new-skin-wrap').hide();
$('.pure-guide-dialog').hide();
$('.vip-activity-wrap-new').hide();
$('.doc-price-voucher-wrap').hide();
$('.btn-pay.2').hide();
$('.btn-pay-vip').hide();
$('.btn-vip').hide();
$('.pager-container').hide();
$('.treasure-main').hide();
$('.fufei-activity-bar').hide();
$(".slide-left").hide();
$(".slide-right").hide();
$(".bg-items-wrapper").empty();
$(".bg-items-wrapper").attr("style","width: 700%; margin-left: -100%; background: linear-gradient(rgb(65, 210, 93), rgb(32, 181, 122));")
$(".slide-circle-wrapper").hide();
$(".promotion-wrapper").hide();
$(".doc-pack-wrapper").hide();
$("#book-rec-wrapper").hide();
$("#app > div.header-wrapper > div.search-wrapper > div.hot-words-wrapper > div.hot-words-items > div:nth-child(2)").hide();
$(".aside-rknow-con").hide();
$(".zsj-topbar.mini").hide();
$(".search-nav").removeClass("zsj-act");
$(".bd-wrap").removeClass("zsj-act");
$(".search-aside-adWrap").hide();
$(".yuedu-recommend-wrap").hide();
$(".header-box-recommend.clearfix.inline").hide();
$(".search-wrapper-box-recommend.clearfix").hide();
$(".footer-box-recommend.clearfix").hide();
$(".summary-recommend.clearfix.has-content").hide();
$(".open-vip-button ").hide();
$("table tr:first").hide();
$("#banurl").hide();
$(".mn-lk-w.member-icon").next().hide();
$("#hd > div > div.nav-wrap.mb10 > div > div > ul.main-nav.side-nav.clearfix > li:nth-child(1)").hide();
$(".top-ads-banner-wrap").hide();
$(".zsj-toppos").hide();
$(".ui-bz-hot-ic").hide();
$(".qua-box").hide();
$("#__elm_view-like-recom__qk_1").hide();
$("#__elm_view-like-recom__qk_2").hide();
$("#__elm_view-like-recom__qk_3").hide();
$(".ft").hide();
$("#next_doc_box").hide();
$(".convert-tip").hide();
$(".toolbar-core-btns-wrap").find(".btn-pay-vip").hide();
$("#relative-doc-item").hide();
$(".welfare-pop-tip").hide();
$(".wangpan-tip").hide();
$(".lastcell-dialog").hide();
$(".service-entry").hide();
$(".ad-area").hide();
$(".banner-ad.banner-wrap.ad-onff").hide();
$(".wkfc-wrap.ad-onff").hide();
$(".banner-ad").hide();
$(".edit-subscription-dialog-wrapper.mod").hide()
$(".hot-option-word-wrapper").hide()
$(".tangram-suggestion-main").hide();
$(".CASH_PACK-CASH.summary").hide();
$(".CASH_PACK-CASH.searchBox").hide();
$(".CASH_PACK-CASH.topBar").hide();
$(".CASH_DISCOUNT-CASH.summary").hide();
$(".CASH_DISCOUNT-CASH.searchBox").hide();
$(".CASH_DISCOUNT-CASH.topBar").hide();
$(".CASH_DISCOUNT-VIP_RIGHT.summary").hide();
$(".CASH_DISCOUNT-VIP_RIGHT.searchBox").hide();
$(".CASH_DISCOUNT-VIP_RIGHT.topBar").hide();
$(".-VIP_RIGHT.summary").hide();
$(".-VIP_RIGHT.searchBox").hide();
$(".-VIP_RIGHT.topBar").hide();
$(".red-text").hide();
$(".operate-wrapper").hide();
$(".bottom-pop-wrap").hide();
$(".pay-layer1509-wrapper").hide();
$(".pay-vip-btn-wrap").hide();
$(".relative-search-wrap").hide();
$(".relative-recommend-wrapper").hide();
$(".operation-wrapper").hide();
$(".relative-doc-wrapper").hide();
$(".relative-course-wrapper").hide();
$(".hot-search-wrapper").hide();
$(".hx-right-wrapper").hide();
$(".doc-voucher-wrap").hide();
$(".core-btn-wrapper.CASH_DISCOUNT-CASH.CASH_DISCOUNT.summary.t1272-0.nafe-1509").hide();
$(".core-btn-wrapper.CASH_DISCOUNT-CASH.CASH_DISCOUNT.searchBox.t1272-0.nafe-1509").hide();
$(".voucher-center-wrap").hide();
$("#add-price-buy-wrap").hide();
$(".recommend-wrap.clearfix.notjigou").hide();
$(".searchMode01").parent().parent().parent().hide();
$(".right-channel-wrap").hide();
$(".ex-wrapper").hide();
$(".query-sug").hide();
},1);
}
})();