Greasy Fork is available in English.

百度文库去广告

去掉相关文档推荐和购买链接

// ==UserScript==
// @name         百度文库去广告
// @namespace    http://tampermonkey.net/
// @version      0.6
// @description  去掉相关文档推荐和购买链接
// @author       AN drew
// @match        https://wenku.baidu.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    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')
    {
        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(){
            $(".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();

        },1);
    }
})();