|
1 | 1 | // ==UserScript== |
2 | 2 | // @name 自动无缝翻页 |
3 | | -// @version 1.3.5 |
| 3 | +// @version 1.3.6 |
4 | 4 | // @author X.I.U |
5 | 5 | // @description 自动无缝翻页,目前支持:所有 Discuz!论坛、423Down、Apphot、不死鸟、小众软件、异次元软件、微当下载、异星软件空间、豆瓣电影、微博评论、3DM游戏网、游侠网、游民星空、千图网、阿里小站、RARBG、FitGirl Repacks、AlphaCoders、PubMed、AfreecaTV... |
6 | 6 | // @match *://*/* |
|
43 | 43 | GM_registerMenuCommand('❎ 已禁用 (点击对当前网站启用)', function(){menu_disable('del')}); |
44 | 44 | return |
45 | 45 | } else { |
46 | | - if (websiteList.indexOf(location.host) > -1 || document.querySelector('meta[name="author"][content*="Discuz!"]')) { |
| 46 | + if (websiteList.indexOf(location.host) > -1 || document.querySelector('meta[name="author"][content*="Discuz!"], meta[name="generator"][content*="Discuz!"]')) { |
47 | 47 | GM_registerMenuCommand('✅ 已启用 (点击对当前网站禁用)', function(){menu_disable('add')}); |
48 | 48 | } else { |
49 | | - |
50 | | - GM_registerMenuCommand('❌ 当前网站暂不支持,请点击下方选项申请支持~'); |
| 49 | + GM_registerMenuCommand('❌ 当前网站暂不支持 [点击申请支持]', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});window.GM_openInTab('https://greasyfork.org/zh-CN/scripts/419215/feedback', {active: true,insert: true,setParent: true});}); |
| 50 | + return |
51 | 51 | } |
52 | 52 | } |
53 | 53 | GM_registerMenuCommand('💬 反馈 & 欢迎申请支持', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});window.GM_openInTab('https://greasyfork.org/zh-CN/scripts/419215/feedback', {active: true,insert: true,setParent: true});}); |
|
104 | 104 | scrollDelta: 1000 |
105 | 105 | } |
106 | 106 | }, |
107 | | - _423down_postslist: { |
| 107 | + discuz_guide: { |
108 | 108 | SiteTypeID: 4, |
| 109 | + pager: { |
| 110 | + type: 1, |
| 111 | + nextLink: '//a[@class="nxt"][@href]', |
| 112 | + pageElement: 'css;div#threadlist div.bm_c table > tbody', |
| 113 | + HT_insert: ['css;div#threadlist div.bm_c table', 3], |
| 114 | + replaceE: 'css;div.pg', |
| 115 | + scrollDelta: 1000 |
| 116 | + } |
| 117 | + }, |
| 118 | + discuz_youspace: { |
| 119 | + SiteTypeID: 5, |
| 120 | + pager: { |
| 121 | + type: 1, |
| 122 | + nextLink: '//a[@class="nxt"][@href]', |
| 123 | + pageElement: 'css;tbody > tr:not(.th)', |
| 124 | + HT_insert: ['css;tbody', 3], |
| 125 | + replaceE: 'css;div.pg', |
| 126 | + scrollDelta: 1000 |
| 127 | + } |
| 128 | + }, |
| 129 | + discuz_collection: { |
| 130 | + SiteTypeID: 6, |
| 131 | + pager: { |
| 132 | + type: 1, |
| 133 | + nextLink: '//a[@class="nxt"][@href]', |
| 134 | + pageElement: 'css;div#ct div.bm_c table > tbody', |
| 135 | + HT_insert: ['css;div#ct div.bm_c table', 3], |
| 136 | + replaceE: 'css;div.pg', |
| 137 | + scrollDelta: 1000 |
| 138 | + } |
| 139 | + }, |
| 140 | + _423down_postslist: { |
| 141 | + SiteTypeID: 7, |
109 | 142 | pager: { |
110 | 143 | type: 1, |
111 | 144 | nextLink: '//div[@class="paging"]//a[contains(text(),"下一页")][@href]', |
|
116 | 149 | } |
117 | 150 | }, |
118 | 151 | apphot_postslist: { |
119 | | - SiteTypeID: 5, |
| 152 | + SiteTypeID: 8, |
120 | 153 | pager: { |
121 | 154 | type: 1, |
122 | 155 | nextLink: '//div[@class="pagination"]//a[contains(text(),"下一页")][@href]', |
|
127 | 160 | } |
128 | 161 | }, |
129 | 162 | iao_su_postslist: { |
130 | | - SiteTypeID: 6, |
| 163 | + SiteTypeID: 9, |
131 | 164 | pager: { |
132 | 165 | type: 1, |
133 | 166 | nextLink: '//li[@class="btn btn-primary next"]//a[@href]', |
|
141 | 174 | } |
142 | 175 | }, |
143 | 176 | appinn_postslist: { |
144 | | - SiteTypeID: 7, |
| 177 | + SiteTypeID: 10, |
145 | 178 | pager: { |
146 | 179 | type: 1, |
147 | 180 | nextLink: '//a[@class="next page-numbers"][@href]', |
|
152 | 185 | } |
153 | 186 | }, |
154 | 187 | iplaysoft_postslist: { |
155 | | - SiteTypeID: 8, |
| 188 | + SiteTypeID: 11, |
156 | 189 | pager: { |
157 | 190 | type: 1, |
158 | 191 | nextLink: '//div[@class="pagenavi"]//a[@title="下一页"][@href]', |
|
166 | 199 | } |
167 | 200 | }, |
168 | 201 | iplaysoft_postcomments: { |
169 | | - SiteTypeID: 9, |
| 202 | + SiteTypeID: 12, |
170 | 203 | pager: { |
171 | 204 | type: 2, |
172 | 205 | nextLink: '#loadHistoryComments', |
|
175 | 208 | } |
176 | 209 | }, |
177 | 210 | pubmed_postslist: { |
178 | | - SiteTypeID: 10, |
| 211 | + SiteTypeID: 13, |
179 | 212 | pager: { |
180 | 213 | type: 2, |
181 | 214 | nextLink: 'button.load-button.next-page', |
|
184 | 217 | } |
185 | 218 | }, |
186 | 219 | wall_alphacoders: { |
187 | | - SiteTypeID: 11, |
| 220 | + SiteTypeID: 14, |
188 | 221 | pager: { |
189 | 222 | type: 1, |
190 | 223 | nextLink: '//a[@id="next_page"][@href]', |
|
195 | 228 | } |
196 | 229 | }, |
197 | 230 | art_alphacoders: { |
198 | | - SiteTypeID: 12, |
| 231 | + SiteTypeID: 15, |
199 | 232 | pager: { |
200 | 233 | type: 1, |
201 | 234 | nextLink: '//a[@id="next_page"][@href]', |
|
209 | 242 | } |
210 | 243 | }, |
211 | 244 | fitgirl: { |
212 | | - SiteTypeID: 13, |
| 245 | + SiteTypeID: 16, |
213 | 246 | pager: { |
214 | 247 | type: 1, |
215 | 248 | nextLink: '//a[@class="next page-numbers"][@href]', |
|
220 | 253 | } |
221 | 254 | }, |
222 | 255 | weidown: { |
223 | | - SiteTypeID: 14, |
| 256 | + SiteTypeID: 17, |
224 | 257 | pager: { |
225 | 258 | type: 1, |
226 | 259 | nextLink: '//a[@class="nextpage"][@href]', |
|
231 | 264 | } |
232 | 265 | }, |
233 | 266 | weidown_search: { |
234 | | - SiteTypeID: 14, |
| 267 | + SiteTypeID: 18, |
235 | 268 | pager: { |
236 | 269 | type: 1, |
237 | 270 | nextLink: '//a[@class="nextpage"][@href]', |
|
242 | 275 | } |
243 | 276 | }, |
244 | 277 | weidown_special: { |
245 | | - SiteTypeID: 14, |
| 278 | + SiteTypeID: 19, |
246 | 279 | pager: { |
247 | 280 | type: 1, |
248 | 281 | nextLink: '//a[@class="nextpage"][@href]', |
|
253 | 286 | } |
254 | 287 | }, |
255 | 288 | douban_subject_comments: { |
256 | | - SiteTypeID: 15, |
| 289 | + SiteTypeID: 20, |
257 | 290 | pager: { |
258 | 291 | type: 1, |
259 | 292 | nextLink: '//a[@class="next"][@href]', |
|
264 | 297 | } |
265 | 298 | }, |
266 | 299 | douban_subject_reviews: { |
267 | | - SiteTypeID: 16, |
| 300 | + SiteTypeID: 21, |
268 | 301 | pager: { |
269 | 302 | type: 1, |
270 | 303 | nextLink: '//link[@rel="next"][@href]', |
|
275 | 308 | } |
276 | 309 | }, |
277 | 310 | douban_subject_episode: { |
278 | | - SiteTypeID: 17, |
| 311 | + SiteTypeID: 22, |
279 | 312 | pager: { |
280 | 313 | type: 1, |
281 | 314 | nextLink: '//link[@rel="next"][@href]', |
|
286 | 319 | } |
287 | 320 | }, |
288 | 321 | douban_search: { |
289 | | - SiteTypeID: 18, |
| 322 | + SiteTypeID: 23, |
290 | 323 | pager: { |
291 | 324 | type: 1, |
292 | 325 | nextLink: '//a[@class="next"][@href]', |
|
297 | 330 | } |
298 | 331 | }, |
299 | 332 | _3dmgame: { |
300 | | - SiteTypeID: 19, |
| 333 | + SiteTypeID: 24, |
301 | 334 | pager: { |
302 | 335 | type: 3, |
303 | 336 | nextLink: '//li[@class="next"]/a[@href]', |
|
309 | 342 | } |
310 | 343 | }, |
311 | 344 | gamersky_ent: { |
312 | | - SiteTypeID: 20, |
| 345 | + SiteTypeID: 25, |
313 | 346 | pager: { |
314 | 347 | type: 3, |
315 | 348 | nextLink: '//div[@class="page_css"]/a[text()="下一页"][@href]', |
|
321 | 354 | } |
322 | 355 | }, |
323 | 356 | gamersky_gl: { |
324 | | - SiteTypeID: 21, |
| 357 | + SiteTypeID: 26, |
325 | 358 | pager: { |
326 | 359 | type: 3, |
327 | 360 | nextLink: '//div[@class="page_css"]/a[text()="下一页"][@href]', |
|
333 | 366 | } |
334 | 367 | }, |
335 | 368 | ali213_www: { |
336 | | - SiteTypeID: 22, |
| 369 | + SiteTypeID: 27, |
337 | 370 | pager: { |
338 | 371 | type: 3, |
339 | 372 | nextLink: '//a[@id="after_this_page"][@href]', |
|
345 | 378 | } |
346 | 379 | }, |
347 | 380 | ali213_gl: { |
348 | | - SiteTypeID: 23, |
| 381 | + SiteTypeID: 28, |
349 | 382 | pager: { |
350 | 383 | type: 3, |
351 | 384 | nextLink: '//a[@class="next n"][@href]', |
|
357 | 390 | } |
358 | 391 | }, |
359 | 392 | _58pic: { |
360 | | - SiteTypeID: 24, |
| 393 | + SiteTypeID: 29, |
361 | 394 | pager: { |
362 | 395 | type: 1, |
363 | 396 | nextLink: '//div[contains(@class,"page-box")]//a[text()="下一页"][@href]', |
|
371 | 404 | } |
372 | 405 | }, |
373 | 406 | _58pic_c: { |
374 | | - SiteTypeID: 25, |
| 407 | + SiteTypeID: 30, |
375 | 408 | pager: { |
376 | 409 | type: 1, |
377 | 410 | nextLink: '//div[contains(@class,"page-box")]//a[text()="下一页"][@href]', |
|
385 | 418 | } |
386 | 419 | }, |
387 | 420 | rarbgprx: { |
388 | | - SiteTypeID: 26, |
| 421 | + SiteTypeID: 31, |
389 | 422 | pager: { |
390 | 423 | type: 1, |
391 | 424 | nextLink: '(//a[@title="next page"])[1][@href]', |
|
396 | 429 | } |
397 | 430 | }, |
398 | 431 | yxssp: { |
399 | | - SiteTypeID: 27, |
| 432 | + SiteTypeID: 32, |
400 | 433 | pager: { |
401 | 434 | type: 1, |
402 | 435 | nextLink: '//div[@class="page-nav td-pb-padding-side"]/a[last()][@href]', |
|
407 | 440 | } |
408 | 441 | }, |
409 | 442 | yuankongjian: { |
410 | | - SiteTypeID: 28, |
| 443 | + SiteTypeID: 33, |
411 | 444 | pager: { |
412 | 445 | type: 2, |
413 | 446 | nextLink: 'button[title="加载更多"]', |
|
416 | 449 | } |
417 | 450 | }, |
418 | 451 | weibo_comment: { |
419 | | - SiteTypeID: 29, |
| 452 | + SiteTypeID: 34, |
420 | 453 | pager: { |
421 | 454 | type: 2, |
422 | 455 | nextLink: 'a[action-type="click_more_comment"]', |
|
425 | 458 | } |
426 | 459 | }, |
427 | 460 | afreecatv: { |
428 | | - SiteTypeID: 30, |
| 461 | + SiteTypeID: 35, |
429 | 462 | pager: { |
430 | 463 | type: 2, |
431 | 464 | nextLink: '.btn-more > button', |
|
534 | 567 | case "www.afreecatv.com": |
535 | 568 | curSite = DBSite.afreecatv; |
536 | 569 | break; |
537 | | - default: // < Discuz! 论坛专用 > |
| 570 | + default: // < Discuz! 论坛专用 > |
538 | 571 | if (location.pathname.indexOf('.html') > -1) { // 判断是不是静态网页(.html 结尾) |
539 | 572 | if (location.pathname.indexOf('forum') > -1) { // 各版块帖子列表 |
540 | 573 | curSite = DBSite.discuz_forum; |
|
550 | 583 | } else if (location.search.indexOf('mod=viewthread') > -1) { // 帖子内 |
551 | 584 | curSite = DBSite.discuz_thread; |
552 | 585 | hidePgbtn(); // 隐藏帖子内的 [下一页] 按钮 |
| 586 | + } else if (location.search.indexOf('mod=guide') > -1) { // 导读帖子列表 |
| 587 | + curSite = DBSite.discuz_guide; |
| 588 | + } else if(location.search.indexOf('mod=space') > -1 && location.search.indexOf('&view=me') > -1) { // 别人的主题/回复 |
| 589 | + curSite = DBSite.discuz_youspace; |
| 590 | + } else if (location.search.indexOf('mod=collection') > -1) { // 淘贴列表 |
| 591 | + curSite = DBSite.discuz_collection; |
553 | 592 | } else if (location.pathname.indexOf('search') > -1) { // 搜索结果 |
554 | 593 | curSite = DBSite.discuz_search; |
| 594 | + } else { // 考虑到部分论坛的部分板块帖子列表 URL 是自定义的 |
| 595 | + curSite = DBSite.discuz_forum; |
555 | 596 | } |
556 | 597 | } |
557 | 598 | } |
|
571 | 612 | let scrollElement = document.querySelector(curSite.pager.scrollElement); |
572 | 613 | //console.log(scrollElement.offsetTop - (scrollTop + scrollHeight), scrollDelta, curSite.SiteTypeID) |
573 | 614 | if (scrollElement.offsetTop - (scrollTop + scrollHeight) <= scrollDelta) { |
574 | | - if (curSite.SiteTypeID === 21) curSite.pager.scrollDelta -= 800 // 游民星空的比较奇葩,需要特殊处理下 |
| 615 | + if (curSite.SiteTypeID === 25) curSite.pager.scrollDelta -= 800 // 游民星空的比较奇葩,需要特殊处理下 |
575 | 616 | ShowPager.loadMorePage(); |
576 | 617 | } |
577 | 618 | } else { |
|
0 commit comments