// ==UserScript== // @name 009各大文库网站 去广告 // @namespace http://tampermonkey.net/ // @version 2 // @description try to take over the world! // @author wufake // @match https://wenku.baidu.com/view/* // @match https://www.doc88.com/p* // @match https://www.docin.com/* // @match https://*.book118.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=baidu.com // @require https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.6.0.js // @license wufake // @grant unsafeWindow // @downloadURL none // ==/UserScript== var $ = jQuery, setting = { "Run": "程序运行", "Over": "程序结束", "Error": "程序出错", "CurrentUrl": "当前的url", } window.onload = main() function main() { setting.CurrentUrl = window.location.href //alert(setting.CurrentUrl) if (setting.CurrentUrl.includes('wenku.baidu.com/')) { // 百度 console.log(setting.Run) setInterval(BaiDu, 100) setTimeout(function() { $('.reader-copy-button').remove() // 除去原来的复制按钮 var fanyibtn = $('.reader-translate-button') fanyibtn.text('复制') fanyibtn.on('click', BdCopy) },1000) } else if (setting.CurrentUrl.includes('www.doc88.com')) { // 道客 setInterval(DaoKe, 100) setInterval(DkCopy,1000) } else if (setting.CurrentUrl.includes('www.docin.com')) { // 豆丁 setInterval(DouDing, 100) } else if (setting.CurrentUrl.includes('book118.com')) { // 原创力 //alert(0) setInterval(YuanChuangLi,100) } } function BaiDu() { try { var dialog_mask = $('.dialog-mask'), retain_dialog = $('.retain-dialog'), hx_warp = $('.hx-warp'), div1 = $('div.search-result-wrap.top-position') hx_warp.remove() div1.remove() dialog_mask.css({"display": "none"}) retain_dialog.css({"display": "none"}) // window.wkCommonLogParam.isLogin = 1 window.wkCommonLogParam.isSuperVip = 1 window.wkCommonLogParam.interceptPage = 100 window.wkCommonLogParam.isVip = 1 } catch { return false } } // 百度选中复制(翻译漏洞) function BdCopy() { var timer = setInterval(function() { try { let fanyilink = $('#reader-fanyi-link'), text $('span.close').click() text = fanyilink.get(0).href text = text.replaceAll(/(http:\/\/fanyi.baidu.com\/#auto2auto\|)/g, '') if (text.includes('http')) { return false } if (! text) { return false } text = decodeURI(text) alert(text) fanyilink.get(0).href = 'http://fanyi.baidu.com/#auto2auto|' clearInterval(timer) //console.log(text) } catch { console.log('出错') return false } },0) } function DaoKe() { try { var page_ad = $('div.page_ad') $('#continueButton').click() } catch { return false } for (var i = 0; i