|
1 | 1 | // ==UserScript== |
2 | 2 | // @name 自动无缝翻页 |
3 | | -// @version 1.8.9 |
| 3 | +// @version 1.9.0 |
4 | 4 | // @author X.I.U |
5 | 5 | // @description 无缝拼接下一页内容,目前支持:[所有使用「Discuz!、Flarum、DUX(WordPress)」的网站]、百度、谷歌、必应、贴吧、豆瓣、微博、NGA(玩家社区)、V2EX、超能网、IT之家、千图网、Pixabay、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、小霸王其乐无穷、茶杯狐、NO视频、低端影视、奈菲影视、91美剧网、真不卡影院、片库、音范丝、BT之家、爱恋动漫、Nyaa、SrkBT、RARBG、423Down、不死鸟、小众软件、极简插件、果核剥壳、六音软件、微当下载、th-sjy 汉化、异次元软件、老殁殁漂遥、异星软件空间、动漫狂、漫画DB、HiComic(嗨漫画)、古风漫画网、砂之船动漫家、PubMed、wikiHow、GreasyFork、CS.RIN.RU、FitGirl... |
6 | 6 | // @match *://*/* |
|
61 | 61 |
|
62 | 62 | } else if (menuAll[i][0] === 'menu_discuz_thread_page') { // 帖子内自动翻页 (仅论坛) |
63 | 63 |
|
64 | | - if (webType === 2 || location.host === 'cs.rin.ru') { |
| 64 | + if (webType === 2 || location.host === 'cs.rin.ru' || location.host === 'www.flyert.com') { |
65 | 65 | menuId[i] = GM_registerMenuCommand(`${menuAll[i][3]?'✅':'❌'} ${menuAll[i][1]}`, function(){menu_switch(menuAll[i][3], menuAll[i][0], menuAll[i][2])}); |
66 | 66 | } |
67 | 67 |
|
|
72 | 72 | menuId[menuId.length] = 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/412212/feedback', {active: true,insert: true,setParent: true});}); |
73 | 73 | } |
74 | 74 |
|
| 75 | + // 网站规则 |
75 | 76 | function setDBSite() { |
76 | 77 | /* |
77 | 78 | 自动翻页规则 |
|
350 | 351 | nextText: '查看更多c', |
351 | 352 | scrollDelta: 1000 |
352 | 353 | } |
353 | | - }, // 微博评论 |
| 354 | + }, // 微博评论 |
354 | 355 | nga_thread: { |
355 | 356 | SiteTypeID: 0, |
356 | 357 | host: 'bbs.nga.cn', |
|
371 | 372 | function: { |
372 | 373 | after: nga_thread_functionAfter |
373 | 374 | } |
374 | | - }, // NGA - 各版块帖子列表 |
| 375 | + }, // NGA - 各版块帖子列表 |
375 | 376 | nga_read: { |
376 | 377 | SiteTypeID: 0, |
377 | 378 | pager: { |
|
383 | 384 | scriptType: 2, |
384 | 385 | scrollDelta: 1000 |
385 | 386 | } |
386 | | - }, // NGA - 帖子内 |
| 387 | + }, // NGA - 帖子内 |
387 | 388 | v2ex_recent: { |
388 | 389 | SiteTypeID: 0, |
389 | 390 | host: ['v2ex.com', 'www.v2ex.com'], |
|
416 | 417 | after: v2ex_functionAfter, |
417 | 418 | parameter: '#Main a.topic-link:not([target])' |
418 | 419 | } |
419 | | - }, // V2EX - 最近主题页 |
| 420 | + }, // V2EX - 最近主题页 |
420 | 421 | v2ex_notifications: { |
421 | 422 | SiteTypeID: 0, |
422 | 423 | pager: { |
|
431 | 432 | after: v2ex_functionAfter, |
432 | 433 | parameter: '#Main a[href^="/t/"]:not([target])' |
433 | 434 | } |
434 | | - }, // V2EX - 提醒消息页 |
| 435 | + }, // V2EX - 提醒消息页 |
435 | 436 | v2ex_replies: { |
436 | 437 | SiteTypeID: 0, |
437 | 438 | pager: { |
|
446 | 447 | after: v2ex_functionAfter, |
447 | 448 | parameter: '#Main a[href^="/t/"]:not([target])' |
448 | 449 | } |
449 | | - }, // V2EX - 用户回复页 |
| 450 | + }, // V2EX - 用户回复页 |
450 | 451 | v2ex_go: { |
451 | 452 | SiteTypeID: 0, |
452 | 453 | pager: { |
|
461 | 462 | after: v2ex_functionAfter, |
462 | 463 | parameter: '#Main a.topic-link:not([target])' |
463 | 464 | } |
464 | | - }, // V2EX - 分类主题页 |
| 465 | + }, // V2EX - 分类主题页 |
465 | 466 | v2ex_balance: { |
466 | 467 | SiteTypeID: 0, |
467 | 468 | pager: { |
|
472 | 473 | replaceE: 'css;#Main > .box > .cell[style] > table', |
473 | 474 | scrollDelta: 1000 |
474 | 475 | } |
475 | | - }, // V2EX - 账户余额页 |
| 476 | + }, // V2EX - 账户余额页 |
476 | 477 | xcar_forumdisplay: { |
477 | 478 | SiteTypeID: 0, |
478 | 479 | host: 'www.xcar.com.cn', |
|
485 | 486 | replaceE: 'css;.forumList_page', |
486 | 487 | scrollDelta: 2000 |
487 | 488 | } |
488 | | - }, // 爱卡汽车网论坛 - 各版块帖子列表 |
| 489 | + }, // 爱卡汽车网论坛 - 各版块帖子列表 |
| 490 | + flyert_forumdisplay: { |
| 491 | + SiteTypeID: 0, |
| 492 | + host: 'www.flyert.com', |
| 493 | + functionStart: function() {if (location.search.indexOf('mod=forumdisplay') > -1) { |
| 494 | + curSite = DBSite.flyert_forumdisplay; |
| 495 | + } else if (location.search.indexOf('mod=viewthread') > -1) { |
| 496 | + if (GM_getValue('menu_discuz_thread_page')) {curSite = DBSite.flyert_viewthread;} |
| 497 | + }}, |
| 498 | + pager: { |
| 499 | + type: 1, |
| 500 | + nextLink: '//a[@class="nxt"][@href][not(contains(@href, "javascript"))]', |
| 501 | + pageElement: 'css;#threadlist table > tbody[id^="normalthread_"]', |
| 502 | + insertPosition: ['id("threadlist")//table/tbody[starts-with(@id, "normalthread_")]/parent::table', 3], |
| 503 | + replaceE: 'css;.pg', |
| 504 | + scrollDelta: 2500 |
| 505 | + } |
| 506 | + }, // 飞客网论坛 - 各版块帖子列表 |
| 507 | + flyert_viewthread: { |
| 508 | + SiteTypeID: 0, |
| 509 | + pager: { |
| 510 | + type: 1, |
| 511 | + nextLink: '//a[@class="nxt"][@href][not(contains(@href, "javascript"))]', |
| 512 | + pageElement: 'css;#postlist > .comiis_viewbox', |
| 513 | + insertPosition: ['css;#postlist', 3], |
| 514 | + replaceE: 'css;.comiis_pgs > .pg', |
| 515 | + scrollDelta: 3000 |
| 516 | + } |
| 517 | + }, // 飞客网论坛 - 帖子内 |
489 | 518 | expreview: { |
490 | 519 | SiteTypeID: 0, |
491 | 520 | host: 'www.expreview.com', |
|
495 | 524 | intervals: 1500, |
496 | 525 | scrollDelta: 1500 |
497 | 526 | } |
498 | | - }, // 超能网 |
| 527 | + }, // 超能网 |
499 | 528 | ithome: { |
500 | 529 | SiteTypeID: 0, |
501 | 530 | host: 'www.ithome.com', |
|
505 | 534 | intervals: 1500, |
506 | 535 | scrollDelta: 1500 |
507 | 536 | } |
508 | | - }, // IT 之家 |
| 537 | + }, // IT 之家 |
509 | 538 | _58pic: { |
510 | 539 | SiteTypeID: 0, |
511 | 540 | host: 'www.58pic.com', |
|
525 | 554 | function: { |
526 | 555 | before: _58pic_functionBefore |
527 | 556 | } |
528 | | - }, // 千图网 - 分类/搜索页 |
| 557 | + }, // 千图网 - 分类/搜索页 |
529 | 558 | _58pic_c: { |
530 | 559 | SiteTypeID: 0, |
531 | 560 | pager: { |
|
539 | 568 | function: { |
540 | 569 | before: _58pic_functionBefore |
541 | 570 | } |
542 | | - }, // 千图网 - 专题/收藏夹 |
| 571 | + }, // 千图网 - 专题/收藏夹 |
543 | 572 | pixabay: { |
544 | 573 | SiteTypeID: 0, |
545 | 574 | host: 'pixabay.com', |
|
2249 | 2278 | console.info('[自动无缝翻页] - Flarum 论坛'); return 3; |
2250 | 2279 | } else if (document.querySelector('link[href*="themes/dux" i], script[src*="themes/dux" i]')) { |
2251 | 2280 | console.info('[自动无缝翻页] - 使用 WordPress DUX 主题的网站'); return 4; |
2252 | | - } else if (location.host === 'www.flyert.com') { |
2253 | | - console.info('[自动无缝翻页] - 部分內嵌的 Discuz! 论坛'); return 2; |
2254 | 2281 | } |
2255 | 2282 | return 0; |
2256 | 2283 | } |
|
2425 | 2452 | try { |
2426 | 2453 | let oriE = getAllElements(curSite.pager.replaceE), |
2427 | 2454 | repE = getAllElements(curSite.pager.replaceE, newBody, newBody); |
| 2455 | + //console.log(oriE, repE); |
2428 | 2456 | if (oriE.length === repE.length) { |
2429 | 2457 | for (let i = 0; i < oriE.length; i++) { |
2430 | 2458 | oriE[i].outerHTML = repE[i].outerHTML; |
|
0 commit comments