11// ==UserScript==
22// @name 自动无缝翻页
3- // @version 2.0.7
3+ // @version 2.0.8
44// @author X.I.U
55// @description 无缝拼接下一页内容(瀑布流),目前支持:[所有使用「Discuz!、Flarum、DUX(WordPress)」的网站]、百度、谷歌、必应、搜狗、微信、贴吧、豆瓣、微博、NGA(玩家社区)、V2EX、看雪论坛、起点小说、煎蛋网、超能网、IT之家、千图网、Pixabay、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、小霸王其乐无穷、茶杯狐、NO视频、低端影视、奈菲影视、91美剧网、真不卡影院、片库、音范丝、BT之家、爱恋动漫、Nyaa、SrkBT、RARBG、SubHD、423Down、不死鸟、小众软件、极简插件、果核剥壳、六音软件、微当下载、th-sjy 汉化、异次元软件、老殁殁漂遥、异星软件空间、动漫狂、漫画猫、漫画DB、HiComic(嗨漫画)、动漫之家、古风漫画网、砂之船动漫家、PubMed、wikiHow、GreasyFork、CS.RIN.RU、FitGirl(更多的写不下了...
66// @match *://*/*
290290 nextText : '加载更多' ,
291291 scrollDelta : 1500
292292 }
293- } , // Magi 搜索
293+ } , // Magi搜索
294294 baidu_tieba : {
295295 SiteTypeID : 0 ,
296296 host : 'tieba.baidu.com' ,
578578 scrollDelta : 1500
579579 }
580580 } , // 看雪论坛 - 帖子内
581+ lkong : {
582+ SiteTypeID : 0 ,
583+ host : 'www.lkong.com' ,
584+ functionStart : function ( ) { if ( location . pathname . indexOf ( '/forum/' ) > - 1 ) {
585+ curSite = DBSite . lkong ;
586+ } else if ( location . pathname . indexOf ( '/thread/' ) > - 1 ) {
587+ curSite = DBSite . lkong_thread ;
588+ } } ,
589+ pager : {
590+ type : 1 ,
591+ nextLink : lkong_functionNext ,
592+ pageElement : '//div[@class="main-title"]/parent::div/parent::div | //head/style[@data-emotion-css]' ,
593+ insertPosition : [ '//div[@class="main-title"][1]/parent::div/parent::div/parent::div' , 3 ] ,
594+ replaceE : 'css;ul.ant-pagination' ,
595+ intervals : 500 ,
596+ scrollDelta : 1200
597+ }
598+ } , // 龙的天空 - 各版块帖子列表
599+ lkong_thread : {
600+ SiteTypeID : 0 ,
601+ pager : {
602+ type : 1 ,
603+ nextLink : lkong_functionNext ,
604+ pageElement : '//div[@class="main-content"]/parent::div | //head/style[@data-emotion-css]' ,
605+ insertPosition : [ '//div[@class="main-content"][1]/parent::div/parent::div' , 3 ] ,
606+ replaceE : 'css;ul.ant-pagination' ,
607+ intervals : 500 ,
608+ scrollDelta : 1200
609+ }
610+ } , // 龙的天空 - 帖子内
581611 xcar_forumdisplay : {
582612 SiteTypeID : 0 ,
583613 host : 'www.xcar.com.cn' ,
20952125 links . forEach ( function ( _this ) { _this . target = '_blank' ; } ) ;
20962126 }
20972127
2128+ // [龙的天空] 获取下一页地址
2129+ function lkong_functionNext ( ) {
2130+ let next = document . querySelector ( 'li.ant-pagination-next' ) , page ;
2131+ if ( next && next . getAttribute ( 'aria-disabled' ) === 'false' ) {
2132+ page = document . querySelector ( 'li.ant-pagination-item-active[title]' ) ;
2133+ if ( page && page . title ) {
2134+ if ( curSite . pager . intervals ) {
2135+ let _SiteTypeID = curSite . SiteTypeID ; curSite . SiteTypeID = 0 ;
2136+ setTimeout ( function ( ) { curSite . SiteTypeID = _SiteTypeID ; } , curSite . pager . intervals )
2137+ }
2138+ return ( location . origin + location . pathname + '?page=' + ++ page . title ) ;
2139+ }
2140+ }
2141+ return '' ;
2142+ }
20982143
20992144 // [千图网] 的插入前函数(加载图片)
21002145 function _58pic_functionBefore ( pageElems ) {
27012746 }
27022747 }
27032748 } else if ( curSite . pager . type === 1 ) { // <<<<< 翻页类型 1(由脚本实现自动无缝翻页)>>>>>
2704- ShowPager . loadMorePage ( ) ;
2749+ if ( curSite . SiteTypeID > 0 ) ShowPager . loadMorePage ( ) ;
27052750 } else if ( curSite . pager . type === 4 ) { // <<<<< 翻页类型 4(部分简单的动态加载类网站)>>>>>
27062751 if ( curSite . SiteTypeID > 0 ) {
27072752 // 为百度贴吧的发帖考虑...
30063051 url = this . getFullHref ( getElementByXpath ( curSite . pager . nextLink ) ) ;
30073052 }
30083053 }
3009- // console.log(url, curSite.pageUrl);
3054+ console . log ( url , curSite . pageUrl ) ;
30103055 if ( url === '' ) return ;
30113056 if ( curSite . pageUrl === url ) return ; // 避免重复加载相同的页面
30123057 curSite . pageUrl = url ;
31533198 }
31543199 }
31553200 }
3201+
3202+ /*// 监听 XMLHttpRequest URL
3203+ var _send = window.XMLHttpRequest.prototype.send
3204+ function sendReplacement(data) {
3205+ console.log(data)
3206+ return _send.apply(this, arguments);
3207+ }
3208+ window.XMLHttpRequest.prototype.send = sendReplacement;
3209+ // 监听 XMLHttpRequest 模式(GET/POST)和数据
3210+ var _open = window.XMLHttpRequest.prototype.open
3211+ function openReplacement(data) {
3212+ console.log(data, arguments)
3213+ return _open.apply(this, arguments);
3214+ }
3215+ window.XMLHttpRequest.prototype.open = openReplacement;*/
31563216} ) ( ) ;
0 commit comments