|
1 | 1 | // ==UserScript== |
2 | 2 | // @name 吾爱破解论坛增强 - 自动签到、翻页 |
3 | | -// @version 1.1.9 |
| 3 | +// @version 1.2.0 |
4 | 4 | // @author X.I.U |
5 | 5 | // @description 自动签到、自动无缝翻页(全站) |
6 | 6 | // @match *://www.52pojie.cn/* |
|
75 | 75 | nextLink: '//div[@id="pgt"]//a[contains(text(),"下一页")][@href]', |
76 | 76 | pageElement: 'css;div#postlist > div[id^="post_"]', |
77 | 77 | HT_insert: ['css;div#postlist', 2], |
78 | | - replaceE: '//div[@class="pg"] | //div[@class="pgbtn"]', |
| 78 | + replaceE: 'css;div.pg', |
79 | 79 | scrollDelta: 766 |
80 | 80 | } |
81 | 81 | }, |
|
132 | 132 | // URL 判断 |
133 | 133 | if (patt_thread.test(location.pathname) || patt_thread_2.test(location.search)){ |
134 | 134 | // 帖子内 |
135 | | - if(menu_thread_pageLoading)curSite = DBSite.thread; |
| 135 | + if(menu_thread_pageLoading) { |
| 136 | + curSite = DBSite.thread; |
| 137 | + hidePgbtn(); // 隐藏帖子内的 [下一页] 按钮 |
| 138 | + } |
136 | 139 | }else if (patt_forum.test(location.pathname) || patt_forum_2.test(location.search)){ |
137 | 140 | // 各板块帖子列表 |
138 | 141 | curSite = DBSite.forum; |
|
195 | 198 | function qianDaoBack() { |
196 | 199 | var qiandaoback = document.querySelector('#messagetext p.alert_btnleft a'); |
197 | 200 | if (qiandaoback){ |
198 | | - setTimeout(function(){qiandaoback.click()}, 100); |
| 201 | + setTimeout(function(){qiandaoback.click()}, 200); |
199 | 202 | } |
200 | 203 | } |
201 | 204 |
|
|
239 | 242 | } |
240 | 243 |
|
241 | 244 |
|
| 245 | + // 隐藏帖子内的 [下一页] 按钮 |
| 246 | + function hidePgbtn(){ |
| 247 | + let style_hidePgbtn = document.createElement('style'); |
| 248 | + style_hidePgbtn.innerHTML = `.pgbtn {display: none;}`; |
| 249 | + document.head.appendChild(style_hidePgbtn); |
| 250 | + } |
| 251 | + |
| 252 | + |
242 | 253 | // 监听 XMLHttpRequest 事件 |
243 | 254 | function EventXMLHttpRequest() { |
244 | 255 | var _send = window.XMLHttpRequest.prototype.send |
|
331 | 342 | // 替换待替换元素 |
332 | 343 | try { |
333 | 344 | let oriE = getAllElements(curSite.pager.replaceE); |
| 345 | + console.log(oriE) |
334 | 346 | let repE = getAllElements(curSite.pager.replaceE, newBody, newBody); |
| 347 | + console.log(repE) |
335 | 348 | if (oriE.length === repE.length) { |
336 | 349 | for (var i = 0; i < oriE.length; i++) { |
337 | 350 | oriE[i].outerHTML = repE[i].outerHTML; |
|
0 commit comments