|
3 | 3 | // @name:zh-CN 自动无缝翻页 |
4 | 4 | // @name:zh-TW 自動無縫翻頁 |
5 | 5 | // @name:en AutoPager |
6 | | -// @version 5.3.8 |
| 6 | +// @version 5.3.9 |
7 | 7 | // @author X.I.U |
8 | 8 | // @description ⭐无缝衔接下一页内容到网页底部(类似瀑布流)⭐,目前支持:【所有「Discuz!、Flarum、phpBB、Xiuno、XenForo、NexusPHP...」论坛】【百度、谷歌(Google)、必应(Bing)、搜狗、微信、360、Yahoo、Yandex 等搜索引擎...】、贴吧、豆瓣、知乎、微博、NGA、V2EX、B 站(Bilibili)、煎蛋网、龙的天空、起点中文、千图网、千库网、Pixabay、Pixiv、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、CS.RIN.RU、RuTracker、BT之家、萌番组、动漫花园、樱花动漫、爱恋动漫、AGE 动漫、Nyaa、SrkBT、RARBG、SubHD、423Down、不死鸟、扩展迷、小众软件、【动漫狂、漫画猫、漫画屋、漫画 DB、动漫之家、拷贝漫画、HiComic、Mangabz、Xmanhua 等漫画网站...】、PubMed、Z-Library、GreasyFork、Github、StackOverflow(以上仅一小部分,更多的写不下了... |
9 | 9 | // @description:zh-TW ⭐無縫銜接下一頁內容到網頁底部(類似瀑布流)⭐,支持各論壇、社交、遊戲、漫畫、小說、學術、搜索引擎(Google、Bing、Yahoo...) 等網站~ |
|
205 | 205 | console.info('[自动无缝翻页] - 独立规则 网站'); return 1; |
206 | 206 | } else if (self != top) { |
207 | 207 | return -1; |
208 | | - } else if (typeof discuz_uid != 'undefined' || getCSS('meta[name="author" i][content*="Discuz!" i], meta[name="generator" i][content*="Discuz!" i], body[id="nv_forum" i][class^="pg_" i][onkeydown*="27"], body[id="nv_search" i][onkeydown*="27"]') || (getCSS('a[href*="www.discuz.net" i]') && getCSS('a[href*="www.discuz.net" i]').textContent.indexOf('Discuz!') > -1) || (getCSS('#ft') && getCSS('#ft').textContent.indexOf('Discuz!') > -1)) { |
209 | | - console.info('[自动无缝翻页] - <Discuz!> 论坛'); return 2; |
210 | | - } else if (getCSS('#flarum-loading')) { |
211 | | - console.info('[自动无缝翻页] - <Flarum> 论坛'); return 3; |
212 | | - } else if (getCSS('body#phpbb')) { |
213 | | - console.info('[自动无缝翻页] - <phpBB> 论坛'); return 4; |
214 | | - } else if (getXpath('//footer//a[contains(string(), "Xiuno")] | //link[contains(@href, "xiuno")] | //script[contains(@src, "xiuno")]')) { |
215 | | - console.info('[自动无缝翻页] - <Xiuno> 论坛'); return 5; |
| 208 | + } else if (typeof discuz_uid != 'undefined') { |
| 209 | + console.info(`[自动无缝翻页] - <Discuz!> 论坛`); return 2; |
| 210 | + } else if (typeof flarum != 'undefined') { |
| 211 | + console.info(`[自动无缝翻页] - <Flarum> 论坛`); return 3; |
| 212 | + } else if (typeof phpbb != 'undefined') { |
| 213 | + console.info(`[自动无缝翻页] - <phpBB> 论坛`); return 4; |
| 214 | + } else if (typeof xn != 'undefined' && getXpath('//footer//a[contains(string(), "Xiuno")] | //link[contains(@href, "xiuno")] | //script[contains(@src, "xiuno")]')) { |
| 215 | + console.info(`[自动无缝翻页] - <Xiuno> 论坛`); return 5; |
216 | 216 | } else if (typeof XF != 'undefined') { |
217 | | - console.info('[自动无缝翻页] - <XenForo> 论坛'); return 6; |
| 217 | + console.info(`[自动无缝翻页] - <XenForo> 论坛`); return 6; |
218 | 218 | } else if (getCSS('head meta[name="generator" i][content="nexusphp" i]') || getXpath('id("footer")[contains(string(), "NexusPHP")]')) { |
219 | | - console.info('[自动无缝翻页] - <NexusPHP> 论坛'); return 7; |
| 219 | + console.info(`[自动无缝翻页] - <NexusPHP> 论坛`); return 7; |
220 | 220 | } else if (getAllCSS('.load-more, .loadmore, #load-more, #loadmore, .show_more').length === 1) { |
221 | | - console.info('[自动无缝翻页] - 部分自带 自动无缝翻页 的网站 1'); return 8; |
| 221 | + console.info(`[自动无缝翻页] - 部分自带 自动无缝翻页 的网站 1`); return 8; |
222 | 222 | } else if (getAllXpath('//*[@onclick][text()="加载更多" or text()="查看更多"][not(@href) or @href="#" or starts-with(@href, "javascript")]').length === 1) { |
223 | | - console.info('[自动无缝翻页] - 部分自带 自动无缝翻页 的网站 2'); return 9; |
| 223 | + console.info(`[自动无缝翻页] - 部分自带 自动无缝翻页 的网站 2`); return 9; |
224 | 224 | } else if (getCSS('link[href*="themes/dux" i], script[src*="themes/dux" i]')) { |
225 | | - console.info('[自动无缝翻页] - 使用 WordPress <DUX> 主题的网站'); return 100; |
| 225 | + console.info(`[自动无缝翻页] - 使用 WordPress <DUX> 主题的网站`); return 100; |
226 | 226 | } else if (getCSS('link[href*="themes/xiu" i], script[src*="themes/xiu" i]')) { |
227 | | - console.info('[自动无缝翻页] - 使用 WordPress <XIU> 主题的网站'); return 101; |
| 227 | + console.info(`[自动无缝翻页] - 使用 WordPress <XIU> 主题的网站`); return 101; |
228 | 228 | } else if (getCSS('link[href*="themes/d8" i], script[src*="themes/d8" i]')) { |
229 | | - console.info('[自动无缝翻页] - 使用 WordPress <D8> 主题的网站'); return 102; |
| 229 | + console.info(`[自动无缝翻页] - 使用 WordPress <D8> 主题的网站`); return 102; |
230 | 230 | } else if (getCSS('link[href*="themes/begin" i], script[src*="themes/begin" i], img[src*="themes/begin" i]')) { |
231 | | - console.info('[自动无缝翻页] - 使用 WordPress <Begin> 主题的网站'); return 103; |
| 231 | + console.info(`[自动无缝翻页] - 使用 WordPress <Begin> 主题的网站`); return 103; |
232 | 232 | } else if (getCSS('link[href*="/wp-content/" i], script[src*="/wp-content/" i]')) { |
233 | 233 | if (getAllCSS('article').length > 2 && getCSS('#nav-below, nav.navigation, nav.pagination, nav.paging-navigation')) { |
234 | 234 | if (getCSS('a.next')) { |
235 | | - console.info('[自动无缝翻页] - 部分使用 WordPress 的网站 (a.next)'); return 104; |
| 235 | + console.info(`[自动无缝翻页] - 部分使用 WordPress 的网站 (a.next)`); return 104; |
236 | 236 | } else if (getCSS('li.next-page > a')) { |
237 | | - console.info('[自动无缝翻页] - 部分使用 WordPress 的网站 (li.next-page > a)'); return 105; |
| 237 | + console.info(`[自动无缝翻页] - 部分使用 WordPress 的网站 (li.next-page > a)`); return 105; |
238 | 238 | } else if (getCSS('.nav-previous a')) { |
239 | | - console.info('[自动无缝翻页] - 部分使用 WordPress 的网站 (旧文章)'); return 106; |
| 239 | + console.info(`[自动无缝翻页] - 部分使用 WordPress 的网站 (旧文章)`); return 106; |
240 | 240 | } else if (getXpath('//nav[@id="nav-below" or contains(@class, "navigation") or contains(@class, "pagination")]//a[contains(text(), "下一页") or contains(text(), ">") or contains(text(), "next") or contains(text(), "Next") or contains(text(), "NEXT")]')) { |
241 | | - console.info('[自动无缝翻页] - 部分使用 WordPress 的网站 (下一页)'); return 107; |
| 241 | + console.info(`[自动无缝翻页] - 部分使用 WordPress 的网站 (下一页)`); return 107; |
242 | 242 | } |
243 | 243 | } |
244 | 244 | } else if ((getCSS('meta[name="description" i][content*="小说"], meta[name="description" i][content*="章节"], meta[name="description" i][content*="阅读"]') || location.hostname.indexOf('biqu') > -1 || document.title.indexOf('笔趣阁') > -1) && getCSS('#content, .content, #chaptercontent, .chaptercontent, #BookText') && getXpath('//a[contains(text(), "下一章") or contains(text(), "下一页")]')) { |
245 | | - console.info('[自动无缝翻页] - <笔趣阁> 模板的小说网站'); return 200; |
| 245 | + console.info(`[自动无缝翻页] - <笔趣阁> 模板的小说网站`); return 200; |
246 | 246 | } |
247 | 247 | return 0; |
248 | 248 | } |
|
263 | 263 | case 7: // < 所有 NexusPHP 论坛 > |
264 | 264 | DBSite.nexusphp.url(); break; |
265 | 265 | case 8: // < 部分自带 自动无缝翻页 的网站 1 > |
266 | | - DBSite.loadmore.url(); break; |
| 266 | + DBSite.loadmore.url('.load-more, .loadmore, #load-more, #loadmore, .show_more'); break; |
267 | 267 | case 9: // < 部分自带 自动无缝翻页 的网站 2 > |
268 | 268 | DBSite.loadmore.url('//*[@onclick][text()="加载更多" or text()="查看更多"][not(@href) or @href="#" or starts-with(@href, "javascript")]'); break; |
269 | 269 | case 100: // < 所有使用 WordPress DUX 主题的网站 > |
|
275 | 275 | case 103: // < 所有使用 WordPress Begin 主题的网站 > |
276 | 276 | DBSite.begin.url(); break; |
277 | 277 | case 104: // < 部分使用 WordPress 的网站 (a.next) > |
278 | | - DBSite.wp_article.url(); break; |
| 278 | + DBSite.wp_article.url('a.next'); break; |
279 | 279 | case 105: // < 部分使用 WordPress 的网站 (li.next-page > a) > |
280 | 280 | DBSite.wp_article.url('li.next-page > a'); break; |
281 | 281 | case 106: // < 部分使用 WordPress 的网站 (旧文章) > |
@@ -361,7 +361,7 @@ function: { |
361 | 361 | */ //<<< 规则简单说明 >>> |
362 | 362 | DBSite = { |
363 | 363 | loadmore: { |
364 | | - url: function(nextL = '.load-more, .loadmore, #load-more, #loadmore, .show_more') {curSite = DBSite.loadmore; curSite.pager.nextL = nextL;}, |
| 364 | + url: function(nextL) {curSite = DBSite.loadmore; curSite.pager.nextL = nextL;}, |
365 | 365 | pager: { |
366 | 366 | type: 2, |
367 | 367 | isHidden: true, |
@@ -585,7 +585,7 @@ function: { |
585 | 585 | } |
586 | 586 | }, // WordPress 的 Begin 主题 - 搜索页 |
587 | 587 | wp_article: { |
588 | | - url: function(nextL = 'a.next') {if (!indexOF('/post/') && !getCSS('#comments, .comments-area, #disqus_thread')) {curSite = DBSite.wp_article; curSite.pager.nextL = nextL; if (getCSS('img[data-src]')) {curSite.function = {bF: "return fun.src_bF(pageE, [0, 'img[data-src]', 'data-src'])"};} else if (getCSS('img[data-original]')) {curSite.function = {bF: "return fun.src_bF(pageE, [0, 'img[data-original]', 'data-original'])"};}}}, |
| 588 | + url: function(nextL) {if (!indexOF('/post/') && !getCSS('#comments, .comments-area, #disqus_thread')) {curSite = DBSite.wp_article; curSite.pager.nextL = nextL; if (getCSS('img[data-src]')) {curSite.function = {bF: "return fun.src_bF(pageE, [0, 'img[data-src]', 'data-src'])"};} else if (getCSS('img[data-original]')) {curSite.function = {bF: "return fun.src_bF(pageE, [0, 'img[data-original]', 'data-original'])"};}}}, |
589 | 589 | pager: { |
590 | 590 | pageE: 'article', |
591 | 591 | replaceE: '#nav-below, nav.navigation, nav.pagination, nav.paging-navigation', |
|
0 commit comments