From 96b0e852b8119b7f4e3031d458fb42145e047435 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 16 Feb 2021 00:39:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E5=B8=96=E5=AD=90?= =?UTF-8?q?=E5=86=85=E8=87=AA=E5=8A=A8=E7=BF=BB=E9=A1=B5=E8=87=B3=E6=9C=80?= =?UTF-8?q?=E5=90=8E=E4=B8=80=E9=A1=B5=E6=97=B6=E9=A1=B5=E6=95=B0=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=B8=8D=E6=AD=A3=E7=A1=AE=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 52pojie-Enhanced.user.js | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/52pojie-Enhanced.user.js b/52pojie-Enhanced.user.js index b3d73d5..36ca810 100644 --- a/52pojie-Enhanced.user.js +++ b/52pojie-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 吾爱破解论坛增强 - 自动签到、翻页 -// @version 1.1.9 +// @version 1.2.0 // @author X.I.U // @description 自动签到、自动无缝翻页(全站) // @match *://www.52pojie.cn/* @@ -75,7 +75,7 @@ nextLink: '//div[@id="pgt"]//a[contains(text(),"下一页")][@href]', pageElement: 'css;div#postlist > div[id^="post_"]', HT_insert: ['css;div#postlist', 2], - replaceE: '//div[@class="pg"] | //div[@class="pgbtn"]', + replaceE: 'css;div.pg', scrollDelta: 766 } }, @@ -132,7 +132,10 @@ // URL 判断 if (patt_thread.test(location.pathname) || patt_thread_2.test(location.search)){ // 帖子内 - if(menu_thread_pageLoading)curSite = DBSite.thread; + if(menu_thread_pageLoading) { + curSite = DBSite.thread; + hidePgbtn(); // 隐藏帖子内的 [下一页] 按钮 + } }else if (patt_forum.test(location.pathname) || patt_forum_2.test(location.search)){ // 各板块帖子列表 curSite = DBSite.forum; @@ -195,7 +198,7 @@ function qianDaoBack() { var qiandaoback = document.querySelector('#messagetext p.alert_btnleft a'); if (qiandaoback){ - setTimeout(function(){qiandaoback.click()}, 100); + setTimeout(function(){qiandaoback.click()}, 200); } } @@ -239,6 +242,14 @@ } + // 隐藏帖子内的 [下一页] 按钮 + function hidePgbtn(){ + let style_hidePgbtn = document.createElement('style'); + style_hidePgbtn.innerHTML = `.pgbtn {display: none;}`; + document.head.appendChild(style_hidePgbtn); + } + + // 监听 XMLHttpRequest 事件 function EventXMLHttpRequest() { var _send = window.XMLHttpRequest.prototype.send @@ -331,7 +342,9 @@ // 替换待替换元素 try { let oriE = getAllElements(curSite.pager.replaceE); + console.log(oriE) let repE = getAllElements(curSite.pager.replaceE, newBody, newBody); + console.log(repE) if (oriE.length === repE.length) { for (var i = 0; i < oriE.length; i++) { oriE[i].outerHTML = repE[i].outerHTML;