文库clear

去广告,展开全文

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         文库clear
// @namespace    http://tampermonkey.net/
// @version      0.0.1
// @description  去广告,展开全文
// @author       You
// @icon         https://www.baidu.com/cache/icon/favicon.ico
// @match        http://wenku.baidu.com/*
// @match        https://wenku.baidu.com/*
// @grant        none
// ==/UserScript==

(function() {
'use strict';
var bannerInterval = 3500;//文中广告
var readInterval = 4000;//展开全文
setTimeout(function(){
var banner=document.getElementsByClassName("banner-ad");
for(var m = (banner.length - 1); m>=0; m--){
            if(banner[m].tagName== "DIV") {
                    banner[m].remove();}
}},bannerInterval);
setTimeout(function(){
    document.getElementsByClassName("moreBtn")[0].click();},readInterval);
//底部悬浮广告
function addGlobalStyle(css) {
        var head, style;
        head = document.getElementsByTagName('head')[0];
        if (!head) { return; }
        style = document.createElement('style');
        style.type = 'text/css';
        style.innerHTML = css;
        head.appendChild(style);
}
addGlobalStyle(`
#lastcell-dialog{display:none;
visibility:hidden;}`);
    // Your code here...
 })();