// ==UserScript== // @name 自动无缝翻页 // @name:zh-CN 自动无缝翻页 // @name:zh-TW 自動無縫翻頁 // @name:en AutoPager // @version 6.6.43 // @author X.I.U // @description ⭐无缝加载 下一页内容 至网页底部(类似瀑布流,无限滚动,无需手动点击下一页)⭐,目前支持:【所有「Discuz!、Flarum、phpBB、MyBB、Xiuno、XenForo、NexusPHP...」论坛】【百度、谷歌(Google)、必应(Bing)、搜狗、微信、360、Yahoo、Yandex 等搜索引擎...】、贴吧、豆瓣、知乎、NGA、V2EX、起点中文、千图网、千库网、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(以上仅一小部分常见网站,更多的写不下了... // @description:zh-TW ⭐無縫加載 下一頁內容 至網頁底部(類似瀑布流,无限滚动,無需手働點擊下一頁)⭐,支持各論壇、社交、遊戲、漫畫、小說、學術、搜索引擎(Google、Bing、Yahoo...) 等網站~ // @description:en Append the next page content to the bottom seamlessly (like a waterfall, Unlimited scrolling, no need to manually click on the next page)~ // @match *://*/* // @connect userscript.xiu2.xyz // @connect userscript.xiu2.us.kg // @connect userscript.h233.eu.org // @connect bitbucket.org // @connect js.cdn.haah.net // @connect raw.ixnic.net // @connect raw.nuaa.cf // @connect raw.yzuu.cf // @connect raw.kkgithub.com // @connect raw.incept.pw // @connect gitdl.cn // @connect ghproxy.cc // @connect ghproxy.net // @connect ghp.ci // @connect github.moeyy.xyz // @connect jsd.onmicrosoft.cn // @connect gcore.jsdelivr.net // @connect fastly.jsdelivr.net // @connect cdn.jsdmirror.com // @connect jsd.proxy.aks.moe // @connect jsdelivr.pai233.top // @connect www.xuexiniu.com // @connect bbs.xuexiniu.com // @connect weili.ooopic.com // @connect www.ykmh.com // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAALfElEQVRYhX2Xe3Bd1XXGf3vvc859X+nq6nUlW5Yly7JlI2xsYzAwtnk4ATpAxkNTHm0mnaTT/gHTTvrIBDLTpp1JUoZppqHQls5AKTR2INOWJJQSXF4x2BhsJCRZ8kuWZckPSVf3/Trn7N3RVTFpQrNn1l97n7O/vda31reWMKMPcmUJA9U8vrwHGdqCHn4HPzePaIxhVSoYbYRXrn7BeMVbCUduF6kVUXHwvQP+6amDaqDnoIompmQytaBnTmB8H5lowrjgFss48SBeI/hUEEZeudLi1ywhJEIJdL6Q8rzal/1a5SGC4XZrYBvWwEZobMdLdH6RH+z/Io1taEeh52fe8tOZbysl/ouWFvANYP7fSz4DgAEBBIL4xiS8ubmnVcTZK68aRK29Dtm8dgnZJydRW+/E2nrnp19nz+7U77+60zt0qMz07J/KxuQTwrIw4rMBCDP6wC+FIIcO34eudDdXf/7jD52Opi772lugY3AZr++hp06gz48j+waRqTWYmVHcS+chEMFeuw1hBzBzY7g/fQE9fmqBYPzBQKrpVa/R4OkCAnXlSvXnX9sIllk220BE4Z8OdHoj54YCK6Od1i2/iUmuRyDRk6NUn3+M0pv/hnf0AE40jEjEqP3oe6Rf/CGOWUTNjFKby2MP7EBtugURFWFxfOhB4+o4yfhrGAdZsxHaqZt6dNce9KXYFSPfGWS68JFqTXSqO7+MCaTqETGTwxSeeoRCOoPT2YUIhFC2jbQF/uwUatU6rPbVUM5T+OfHUO3dWKv6kSsGUIOD6PEPr+fswnanpecFZYVQhFAyjPS9Tj4xw2rcU+pJApEutWsvRjaBW8NUShilkE1JIqlUPfi6VMLNFTBVr+7KYKqJ8uEjlM+dJrR5K0L7eB+9hTd2CFrWYt33h0jH3O5Nj37TBGtgZUBkUN/6q4dQ7UmsnlW450//gU5PPRq460uQXAu+j//i99A/+UdUMoXqbMNkz2OnUkixlF4u9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Q/3RnlvxG5M4kYa3Lc2u4uyFblnIE+xfAbF2RMtqZGsn/uTYUgHH+dz9eFMnqYx8gO+CEwkjhcDPF/DLHurSaeTm3RiWMsDHeuDrSFvBv3+bi08+N1Vwuj/vZWtu+dwclZlFrESoeZmZysJXoTsCjnVk8dDQBuN+n8RDD9fbcdG7leBX1iOkQjhBOHmQfKGAHW3CS6fR+QClmYuYMyPY265DtPVgtfctiw4V/GcfYfGNQzj3/u4DqlormUoZEQwuc0I//eSnY4G0wPJjmdGhw+mh0fWxNZ0037cXccPd1MXgk+GjNE/tR3+Le+YEyg5TnT6LXlwgcu1u7C99HZlsv3K2+vjvkTs2RvDe3747tm7Dy1SKvzSYPP/MLwxFAkIKEzEye2zswOXX395lJyK0fOFzRHfuglQfqPin59Nn0RNDuJk09vprkd0brmx5H7xCbfgQbrZ83OkfvN1pj0+ZmkBYNhjzCwCeffr/AsBDJyU6kqBwbPzRuTcP/GXV82lYlaJpfQ+BjVdhXX0tNKTAjvzKqKXPTeC++1NKY0c9kVz1SGzb9X8tjIdfzSFCDfUw/noA0scPuxBrwcvmmH3rQIvMm3/y0XdJS4JfIpiIUG9g+wcg6KDnZpGZNDQ0Ii5cSAtlPRHYct13axWvJNwadiiAli4iEP8VAJ89HQtR129TLiG1nos0Nt8dSOi12qi9lRq3utVqT/lirql24hW3vLBQi3d3XUqu73+PZOonBNR/WnbYSMeGTO5/Xf6ZtwDwPwtFRezQVs+sAAAAAElFTkSuQmCC // @grant GM_xmlhttpRequest // @grant GM_registerMenuCommand // @grant GM_unregisterMenuCommand // @grant GM_openInTab // @grant GM_getValue // @grant GM_setValue // @grant GM_notification // @grant GM_info // @grant GM.info // @grant window.onurlchange // @grant unsafeWindow // @sandbox JavaScript // @license GPL-3.0 License // @run-at document-end // @namespace https://github.com/XIU2/UserScript // @supportURL https://github.com/XIU2/UserScript // @homepageURL https://github.com/XIU2/UserScript // @exclude https://*.taobao.com/* // @exclude https://*.tmall.com/* // @exclude https://*.1688.com/* // @exclude https://*.jd.com/* // @exclude https://*.vip.com/* // @exclude https://*.suning.com/* // @exclude https://*.aliexpress.com/* // @exclude https://*.paypal.com/* // @exclude https://*.iqiyi.com/* // @exclude https://*.youku.com/* // @exclude https://m.v.qq.com/* // @exclude https://v.qq.com/* // @exclude https://*.acfun.cn/* // @exclude https://t.bilibili.com/* // @exclude https://www.bilibili.com/* // @exclude https://live.bilibili.com/* // @exclude https://space.bilibili.com/* // @exclude https://manga.bilibili.com/* // @exclude https://member.bilibili.com/* // @exclude https://message.bilibili.com/* // @exclude https://*.youtube.com/* // @exclude https://*.youtube-nocookie.com/* // @exclude https://*.cnki.net/* // @exclude https://mail.qq.com/* // @exclude https://weread.qq.com/* // @exclude https://*.weread.qq.com/* // @exclude https://www.qidian.com/chapter/* // @exclude https://bz.zzzmh.cn/* // @exclude https://wallhaven.cc/* // @exclude https://chrome.zzzmh.cn/* // @exclude https://*.guazi.com/* // @exclude https://*.liepin.com/* // @exclude https://*.58.com/* // ==/UserScript== (function() { 'use strict'; const urlArr = [ // 外置翻页规则更新地址分流,以确保更新成功率(记得 connect) 'https://userscript.h233.eu.org/other/Autopage/rules.json', 'https://userscript.xiu2.us.kg/other/Autopage/rules.json', 'https://bitbucket.org/xiu2/userscript/raw/master/other/Autopage/rules.json', 'https://raw.kkgithub.com/XIU2/UserScript/master/other/Autopage/rules.json', 'https://gitdl.cn/https://raw.githubusercontent.com/XIU2/UserScript/master/other/Autopage/rules.json', 'https://raw.incept.pw/XIU2/UserScript/master/other/Autopage/rules.json', 'https://raw.ixnic.net/XIU2/UserScript/master/other/Autopage/rules.json', //'https://raw.nuaa.cf/XIU2/UserScript/master/other/Autopage/rules.json', //'https://raw.yzuu.cf/XIU2/UserScript/master/other/Autopage/rules.json', 'https://ghproxy.cc/https://raw.githubusercontent.com/XIU2/UserScript/master/other/Autopage/rules.json', 'https://ghproxy.net/https://raw.githubusercontent.com/XIU2/UserScript/master/other/Autopage/rules.json', 'https://ghp.ci/https://raw.githubusercontent.com/XIU2/UserScript/master/other/Autopage/rules.json', 'https://github.moeyy.xyz/https://raw.githubusercontent.com/XIU2/UserScript/master/other/Autopage/rules.json', 'https://jsd.onmicrosoft.cn/gh/XIU2/UserScript/other/Autopage/rules.json', //'https://gcore.jsdelivr.net/gh/XIU2/UserScript/other/Autopage/rules.json', 'https://fastly.jsdelivr.net/gh/XIU2/UserScript/other/Autopage/rules.json', 'https://cdn.jsdmirror.com/gh/XIU2/UserScript/other/Autopage/rules.json', 'https://jsd.proxy.aks.moe/gh/XIU2/UserScript/other/Autopage/rules.json', 'https://jsdelivr.pai233.top/gh/XIU2/UserScript/other/Autopage/rules.json', 'https://js.cdn.haah.net/gh/XIU2/UserScript/other/Autopage/rules.json', ], urlArr2 = [ 'https://userscript.h233.eu.org/other/Autopage/rules.json', 'https://userscript.xiu2.us.kg/other/Autopage/rules.json', 'https://userscript.xiu2.xyz/other/Autopage/rules.json', 'https://bitbucket.org/xiu2/userscript/raw/master/other/Autopage/rules.json', 'https://raw.kkgithub.com/XIU2/UserScript/master/other/Autopage/rules.json', 'https://gitdl.cn/https://raw.githubusercontent.com/XIU2/UserScript/master/other/Autopage/rules.json', 'https://raw.ixnic.net/XIU2/UserScript/master/other/Autopage/rules.json', //'https://raw.nuaa.cf/XIU2/UserScript/master/other/Autopage/rules.json', //'https://raw.yzuu.cf/XIU2/UserScript/master/other/Autopage/rules.json', 'https://ghproxy.net/https://raw.githubusercontent.com/XIU2/UserScript/master/other/Autopage/rules.json', 'https://ghp.ci/https://raw.githubusercontent.com/XIU2/UserScript/master/other/Autopage/rules.json', 'https://github.moeyy.xyz/https://raw.githubusercontent.com/XIU2/UserScript/master/other/Autopage/rules.json', ], loadMoreExclude1 = ['.smzdm.com','stackoverflow.com'], loadMoreExclude2 = ['.steampowered.com','.zcool.com.cn']; var menuAll = [ ['menu_disable', '✅ 已启用 (点击对当前网站禁用)', '❌ 已禁用 (点击对当前网站启用)', []], ['menu_thread', '帖子内自动翻页 (社区类网站)', '帖子内自动翻页 (社区类网站)', true], ['menu_page_number', '显示当前页码及点击暂停翻页', '显示当前页码及点击暂停翻页', true], ['menu_pause_page', '左键双击网页空白处暂停翻页', '左键双击网页空白处暂停翻页', false], ['menu_history', '添加历史记录+修改地址/标题', '添加历史记录+修改地址/标题', true], ['menu_rules', '更新外置翻页规则 (每天自动)', '更新外置翻页规则 (每天自动)', {}], ['menu_customRules', '自定义翻页规则', '自定义翻页规则', {}] ], menuId = [], webType = 0, curSite = {SiteTypeID: 0}, DBSite, DBSite2, DBSiteNow, pausePage = true, pageNum = {now: 1, _now: 1}, urlC = false, nowLocation = '', lp = location.pathname, scriptHandler; window.autoPage = {lp: ()=>location.pathname, indexOF: indexOF, isMobile: isMobile, isUrlC: isUrlC, isPager: isPager, isTitle: isTitle, blank: forceTarget, getAll: getAll, getOne: getOne, getAllXpath: getAllXpath, getXpath: getXpath, getAllCSS: getAllCSS, getCSS: getCSS, getNextE: getNextE, getNextEP: getNextEP, getNextSP: getNextSP, getNextEPN: getNextEPN, getNextUPN: getNextUPN, getNextUP: getNextUP, getNextF: getNextF, getSearch: getSearch, getCookie: getCookie, insStyle: insStyle, insScript: insScript, cleanuEvent: cleanuEvent, src_bF: src_bF, xs_bF: xs_bF, pageNumIncrement: pageNumIncrement} if (typeof GM_info != 'undefined') {scriptHandler = GM_info.scriptHandler;} else if (typeof GM != 'undefined' && typeof GM.info != 'undefined') {scriptHandler = GM.info.scriptHandler;} else {scriptHandler = '';} for (let i=0;i 论坛`); return 2; } else if (typeof flarum != 'undefined' || getCSS('#flarum-loading')) { console.info(`[自动无缝翻页] - 论坛`); return 3; } else if (typeof phpbb != 'undefined' || getCSS('body#phpbb')) { console.info(`[自动无缝翻页] - 论坛`); return 4; } else if (typeof xn != 'undefined' && getXpath('//footer//a[contains(string(), "Xiuno")] | //link[contains(@href, "xiuno")] | //script[contains(@src, "xiuno")]')) { console.info(`[自动无缝翻页] - 论坛`); return 5; } else if (typeof XF != 'undefined') { console.info(`[自动无缝翻页] - 论坛`); return 6; } else if (typeof MyBB != 'undefined') { console.info(`[自动无缝翻页] - 论坛`); return 14; } else if (getCSS('head meta[name="generator" i][content="nexusphp" i]') || getXpath('id("footer")[contains(string(), "NexusPHP")]')) { console.info(`[自动无缝翻页] - 论坛`); return 7; } else if (unsafeWindow.config && ((unsafeWindow.config.assetVersionEncoded && unsafeWindow.config.assetVersionEncoded.indexOf('gitea') !== -1) || (unsafeWindow.config.customEmojis && unsafeWindow.config.customEmojis.gitea))) { console.info(`[自动无缝翻页] - git 托管系统`); return 15; } else if (loadMoreExclude(loadMoreExclude1) && getAllCSS('.load-more, .load_more, .loadmore, #load-more, #load_more, #loadmore, [id^="loadmore"], .show-more, .show_more, .ajax-more').length === 1) { console.info(`[自动无缝翻页] - 部分自带 自动无缝翻页 的网站 1`); return 8; } else if (loadMoreExclude(loadMoreExclude2) && getAllXpath('//*[self::a or self::span or self::button or self::div][text()="加载更多"][not(@href) or @href="#" or starts-with(@href, "javascript")]').length === 1) { console.info(`[自动无缝翻页] - 部分自带 自动无缝翻页 的网站 2`); return 9; } else if (getCSS('link[href*="/wp-content/" i], script[src*="/wp-content/" i], link[href*="/wp-includes/" i], script[src*="/wp-includes/" i], head>meta[name=generator][content*="WordPress" i]')) { //if (getAllCSS('article[class], div[id^="post-"], ul[class*="post"]>li.item, .post').length < 4 || getCSS('#nav-below, nav.navigation, nav.paging-navigation, .pagination, .wp-pagenavi, .pagenavi')) return 0; if (getXpath('(//*[contains(@class, "post-page-numbers") and contains(@class, "current")])[last()]/following-sibling::a[1]')) { DBSite.wp_article_post.pager.nextL = '(//*[contains(@class, "post-page-numbers") and contains(@class, "current")])[last()]/following-sibling::a[1]'; DBSite.wp_article_post.pager.replaceE = '//a[contains(@class,"post-page-numbers")]/..'; } else if (getXpath('(//div[contains(@class,"fenye")])[last()]//a[string()="下一页"]')) { DBSite.wp_article_post.pager.nextL = '(//div[contains(@class,"fenye")])[last()]//a[string()="下一页"]'; DBSite.wp_article_post.pager.replaceE = '.fenye'; } if (DBSite.wp_article_post.pager.nextL != undefined) { if (getAllCSS('#entry-content>#content-innerText, .entry-content>#content-innerText').length == 1) { DBSite.wp_article_post.pager.pageE = '#entry-content>#content-innerText, .entry-content>#content-innerText' } else if (getAllCSS('.entry-content .single-content img').length > 3) { DBSite.wp_article_post.pager.pageE = '.entry-content .single-content' } else if (getAllCSS('.entry-content').length == 1) { DBSite.wp_article_post.pager.pageE = '.entry-content>*:not(.wbp-cbm):not(.page-links):not(.post-links):not(.article-paging):not(.entry-pagination):not(.pagination):not(.fenye):not(.open-message):not(#social):not(.article-social):not(.single-cat-tag):not(.single-meta):not(#fontsize):not(.clear):not(.tg-m):not(.tg-site):not(footer)' } else if (getAllCSS('.article-content').length == 1) { DBSite.wp_article_post.pager.pageE = '.article-content>*:not(.page-links):not(.post-links):not(.article-paging):not(.entry-pagination):not(.pagination):not(.fenye):not(.open-message):not(#social):not(.article-social):not(.single-cat-tag):not(.single-meta):not(#fontsize):not(.clear):not(.tg-m):not(.tg-site):not(footer)' } else if (getAllCSS('article').length == 1) { DBSite.wp_article_post.pager.pageE = 'article>*:not(.page-links):not(.post-links):not(.article-paging):not(.entry-pagination):not(.pagination):not(.fenye):not(.open-message):not(#social):not(.article-social):not(.single-cat-tag):not(.single-meta):not(#fontsize):not(.clear):not(.tg-m):not(.tg-site):not(footer)' } if (DBSite.wp_article_post.pager.pageE != undefined) console.info(`[自动无缝翻页] - 部分使用 WordPress 的网站 - 文章内`); return 11; } if (getCSS('a.next, a.next-page')) { DBSite.wp_article.pager.nextL = 'a.next, a.next-page' } else if (getCSS('a[rel="next" i], a[aria-label="next" i], a[aria-label="下一个"].page-link, a[aria-label="Next Page" i], a[aria-label="下一页"], a[rel="下一页"], a[title="下一页"], a[aria-label="下一頁"], a[rel="下一頁"], a[title="下一頁"]')) { DBSite.wp_article.pager.nextL = 'a[rel="next" i], a[aria-label="next" i], a[aria-label="下一个"].page-link, a[aria-label="Next Page" i], a[aria-label="下一页"], a[rel="下一页"], a[title="下一页"], a[aria-label="下一頁"], a[rel="下一頁"], a[title="下一頁"]' } else if (getCSS('li.next-page > a, li.next > a, li.pagination-next>a')) { DBSite.wp_article.pager.nextL = 'li.next-page > a, li.next > a, li.pagination-next>a' } else if (getCSS('span.current+a')) { DBSite.wp_article.pager.nextL = 'span.current+a' } else if (getCSS('.nav-previous a, a.nav-previous')) { DBSite.wp_article.pager.nextL = '.nav-previous a, a.nav-previous' } else if (getCSS('.pagination>.page-item.active+li.page-item>a')) { DBSite.wp_article.pager.nextL = '.pagination>.page-item.active+li.page-item>a' } else { const temp_page = getCSS('#nav-below, nav.navigation, nav.paging-navigation, #pagination:not([class*="entry"]), .pagination:not([class*="entry"]), .wp-pagenavi, .pagenavi, nav[role="navigation"]') if (temp_page && getXpath('//a[contains(text(), "下一页") or contains(text(), "下一頁") or contains(text(), ">") or contains(text(), "next") or contains(text(), "Next") or contains(text(), "NEXT")]', temp_page)) { DBSite.wp_article.pager.nextL = '//*[self::ul or self::nav or self::div][@id="nav-below" or @id="pagination" or contains(@class, "navigation") or contains(@class, "pagination") or contains(@class, "pagenavi") or @role="navigation"]//a[contains(text(), "下一页") or contains(text(), "下一頁") or contains(text(), ">") or contains(text(), "next") or contains(text(), "Next") or contains(text(), "NEXT")]' } } if (DBSite.wp_article.pager.nextL != undefined) { if (DBSite.wp_article.pager.nextL.indexOf('//') !== 0) DBSite.wp_article.pager.replaceE += ',' + DBSite.wp_article.pager.nextL if (getAllCSS('main').length == 1) { if (getAllCSS('main .posts-wrapper.row>div>article').length > 3) { DBSite.wp_article.pager.pageE = 'main .posts-wrapper.row>div' } else if (getAllXpath('//main//div[contains(@class,"row")]/div/article').length > 3) { DBSite.wp_article.pager.pageE = '//main//div[contains(@class,"row")]/div/article/parent::div' } else if (getAllCSS('main article[id^="post-"]').length > 3) { DBSite.wp_article.pager.pageE = 'main article[id^="post-"]' } else if (getAllCSS('main article[class]').length > 3) { DBSite.wp_article.pager.pageE = 'main article[class]' } else if (getAllCSS('main div[id^="post-"]').length > 3) { DBSite.wp_article.pager.pageE = 'main div[id^="post-"]' } else if (getAllCSS('main .post').length > 3) { DBSite.wp_article.pager.pageE = 'main .post' } if (DBSite.wp_article.pager.pageE != undefined) {console.info(`[自动无缝翻页] - 部分使用 WordPress 的网站`); return 10;} } if (getAllCSS('.posts-wrapper.row>div>article').length > 3) { DBSite.wp_article.pager.pageE = '.posts-wrapper.row>div' } else if (getAllXpath('//div[contains(@class,"row")]/div/article').length > 3) { DBSite.wp_article.pager.pageE = '//div[contains(@class,"row")]/div/article/parent::div' } else if (getAllCSS('article[id^="post-"]').length > 3) { DBSite.wp_article.pager.pageE = 'article[id^="post-"]' } else if (getAllCSS('article[class]').length > 3) { DBSite.wp_article.pager.pageE = 'article[class]' } else if (getAllCSS('div[id^="post-"]').length > 3) { DBSite.wp_article.pager.pageE = 'div[id^="post-"]' } else if (getAllCSS('ul[class*="post"]>li.item').length > 3) { DBSite.wp_article.pager.pageE = 'ul[class*="post"]>li.item' } else if (getAllCSS('.post').length > 3) { DBSite.wp_article.pager.pageE = '.post' } else if (getAllCSS('.posts-row>posts[class*="post"]').length > 3) { DBSite.wp_article.pager.pageE = '.posts-row>posts[class*="post"]' } else if (getAllCSS('#posts, .posts').length == 1) { DBSite.wp_article.pager.pageE = '#posts, .posts' } else if (getAllCSS('#content .container>.row').length == 1 && getAllCSS('#content .container>.row+.nav-pagination').length == 1) { DBSite.wp_article.pager.pageE = '#content .container>.row' } if (DBSite.wp_article.pager.pageE != undefined) {console.info(`[自动无缝翻页] - 部分使用 WordPress 的网站`); return 10;} } } else if (getCSS('meta[name="template" i][content="handsome" i]') && getCSS('.page-navigator')) { console.info(`[自动无缝翻页] - 部分使用 Typecho 的网站 (handsome)`); return 12; } else if (getCSS('meta[name="template" i][content="Mirages" i]') && getCSS('.page-navigator')) { console.info(`[自动无缝翻页] - 部分使用 Typecho 的网站 (Mirages)`); return 13; } else if (getCSS('.stui-page, .stui-page__item, #long-page, .myui-page, .myui-page__item')) { console.info(`[自动无缝翻页] - 部分影视网站`); return 300; } else if (getCSS('#page') && getCSS('.module-items,a.module-poster-item')) { console.info(`[自动无缝翻页] - 部分影视网站 2`); return 301; } else if (getCSS('.ArticleImageBox, .PictureList') && getCSS('.article_page') && getXpath('//div[contains(@class,"article_page")]//a[text()="下一页"]')) { console.info(`[自动无缝翻页] - 部分美女图站 - 手机版`); return 302; } else if (getCSS('meta[content^=SearXNG i], link[href*=SearXNG i], script[src*=SearXNG i]')) { console.info(`[自动无缝翻页] - 元搜索引擎`); return 303; } else if (getCSS('.content > #content') && getXpath('//div[contains(@class,"page_chapter")]//a[text()="下一章"]')) { console.info(`[自动无缝翻页] - <笔趣阁 1> 模板的小说网站`); return 200; } else if (getCSS('#nr1, #chaptercontent, .Readarea, .ReadAjax_content') && getCSS('#pb_next, #linkNext')) { console.info(`[自动无缝翻页] - <笔趣阁 1 - 手机版> 模板的小说网站`); return 201; } else if (getCSS('#txt, .txt') && getCSS('#pb_next, .url_next') && getCSS('.chapter-control, .chapter-page-btn')) { console.info(`[自动无缝翻页] - <笔趣阁 2> 模板的小说网站`); return 202; } else if ((getCSS('meta[name="description" i][content*="小说"], meta[name="description" i][content*="章节"], meta[name="description" i][content*="阅读"], meta[name="keywords" i][content*="笔趣"]') || location.hostname.indexOf('biqu')!=-1 || document.title.match(/笔趣阁|小说|章/)!=null) && getXpath('//a[contains(text(), "下一章") or contains(text(), "下一页") or contains(text(), "下一节")]')) { let biquge3_pageE= ['[id="chapter_content" i]','[class~="chapter_content" i]','[id="chaptercontent" i]','[class~="chaptercontent" i]','[id="booktext" i]','[class~="booktext" i]','[id="txtcontent" i]','[class~="txtcontent" i]','[id="textcontent" i]','[class~="textcontent" i]','[id="read-content" i]','[class~="read-content" i]','[id="txtnav" i]','[class~="txtnav" i]','[id="txt" i][class~="txt" i]','[id="contents" i]','[class~="contents" i]','[id="content" i]','[class~="content" i]'] for(let biquge3_pageE_ of biquge3_pageE) {if (getAllCSS(biquge3_pageE_).length === 1) {DBSite.biquge3.pager.pageE = biquge3_pageE_;DBSite.biquge3.pager.insertP = [biquge3_pageE_,6];DBSite.biquge3.style = biquge3_pageE_+'>.readinline, ' + DBSite.biquge3.style;break;}} if (DBSite.biquge3.pager.pageE != undefined) {console.info(`[自动无缝翻页] - <笔趣阁 3> 模板的小说网站`); return 203;} } return 0; } // 判断网站类型 function webTypeIf() { if (webType != 1) { switch (webType) { case 2: // < 所有 Discuz!论坛 > discuz_(); break; case 3: // < 所有 Flarum 论坛 > DBSite.flarum.url(); break; case 4: // < 所有 phpBB 论坛 > DBSite.phpbb.url(); break; case 5: // < 所有 Xiuno 论坛 > DBSite.xiuno.url(); break; case 6: // < 所有 XenForo 论坛 > DBSite.xenforo.url(); break; case 14: // < 所有 MyBB 论坛 > DBSite.mybb.url(); break; case 7: // < 所有 NexusPHP 论坛 > DBSite.nexusphp.url(); break; case 15: // < 所有 Forgejo/Gitea> git 托管系统 > DBSite.forgejoGitea.url(); break; case 8: // < 部分自带 自动无缝翻页 的网站 1 > DBSite.loadmore.url('.load-more, .load_more, .loadmore, #load-more, #load_more, #loadmore, [id^="loadmore"], .show-more, .show_more, .ajax-more'); break; case 9: // < 部分自带 自动无缝翻页 的网站 2 > DBSite.loadmore.url('//*[self::a or self::span or self::button or self::div][text()="加载更多"][not(@href) or @href="#" or starts-with(@href, "javascript")]'); break; case 10: // < 部分使用 WordPress 的网站 > DBSite.wp_article.url(); break; case 11: // < 部分使用 WordPress 的网站 - 文章内 > curSite = DBSite.wp_article_post; break; case 12: // < 部分使用 Typecho 的网站 (handsome) > DBSite.typecho_handsome.url(); break; case 13: // < 部分使用 Typecho 的网站 (Mirages) > DBSite.typecho_mirages.url(); break; case 200: // < 所有使用 笔趣阁 1 模板的小说网站 > DBSite.biquge1.url(); break; case 201: // < 所有使用 笔趣阁 1 - 手机版 模板的小说网站 > curSite = DBSite.biquge1_m; break; case 202: // < 所有使用 笔趣阁 2 模板的小说网站 > DBSite.biquge2.url(); break; case 203: // < 所有使用 笔趣阁 3 模板的小说网站 > curSite = DBSite.biquge3; break; case 300: // < 部分影视网站 > curSite = DBSite.yingshi; break; case 301: // < 部分影视网站 2 > curSite = DBSite.yingshi2; break; case 302: // < 部分美女图站 - 手机版 > curSite = DBSite.meinvtu_m; break; case 303: // < SearXNG 元搜索引擎 > document.cookie='infinite_scroll=1; expires=Thu, 18 Dec 2031 12:00:00 GMT; path=/'; document.cookie='results_on_new_tab=1; expires=Thu, 18 Dec 2031 12:00:00 GMT; path=/'; break; } } } // 内置翻页规则 function setDBSite() { /* inherits: 继承标识,仅用于自定义规则,用于增删改某个外置规则的部分规则时,可使用该标识来省略不需要修改的规则,只写有变化的规则 url: 匹配到该域名后要执行的函数/正则(一般用于根据 URL 分配相应翻页规则) urlC: 对于使用 pjax 技术的网站,需要监听 URL 变化来重新判断翻页规则(需要放在 url: 中,自定义规则的话需要使用 fun.isUrlC()) noReferer: 获取下一页内容时,不携带 Referer(部分网站携带与不携带可能不一样) hiddenPN: 不显示脚本左下角的页码 history: 添加历史记录 并 修改当前 URL(默认开启,对于不支持的网站要设置为 false) thread: 对于社区类网站,要在 帖子内 的规则中加入这个,用于脚本的 [帖子内自动翻页] 功能(即用户可以选择开启/关闭所有社区类网站帖子内的自动翻页) style: 要插入网页的 CSS Style 样式,当只需要单纯屏蔽部分网页元素时,可以只写 CSS 选择器省略掉 {display: none !important;} retry: 允许获取失败后重试 blank: 强制新标签页打开链接 1 = 网页 添加 来让所有链接默认新标签页打开(对已单独指定 target 或已监听点击事件的元素无效) 2 = 对 委托点击事件 3 = 对 pageE 的父元素 委托点击事件(也会阻止冒泡,但因为距离 标签较远,因此只有在委托点击事件的元素是 pageE 的父元素的父元素时,才有意义) 4 = 对 pageE 的子元素 标签 添加 target="_blank" 5 = 对 pageE 的子元素 标签 清理事件后 再添加 target="_blank" 6 = 对 pageE 的子元素 标签 清理事件后 再添加 target="_blank" 并阻止冒泡(避免父元素事件委托捕获该元素的点击事件) pager: { type: 翻页模式 1 = 由脚本实现自动无缝翻页,可省略(适用于:静态加载内容网站,常规模式) 2 = 只需要点击下一页按钮(适用于:网站自带了 自动无缝翻页 功能) nextText: 按钮文本,当按钮文本 = 该文本时,才会点击按钮加载下一页(避免一瞬间加载太多次下一页,下同) nextTextOf: 按钮文本的一部分,当按钮文本包含该文本时,才会点击按钮加载下一页 nextHTML: 按钮内元素,当按钮内元素 = 该元素内容时,才会点击按钮加载下一页 interval: 点击间隔时间,对于没有按钮文字变化的按钮,可以手动指定间隔时间(省略后默认 500ms,当指定上面三个时,会忽略 interval) isHidden: 只有下一页按钮可见时(没有被隐藏),才会点击 3 = 依靠 [基准元素] 与 [浏览器可视区域底部] 之间的距离缩小来触发翻页(适用于:主体元素下方内容太多 且 高度不固定时) scrollE: 作为基准线的元素(一般为底部页码元素),和 replaceE 一样的话可以省略 scrollD: 当 [基准元素] 与 [可视区域底部] 之间的距离 等于或小于该值时,将触发翻页,省略后默认 2000 4 = 动态加载类网站(适用于:简单的动态加载内容网站) insertE: 用来插入元素的函数 5 = 插入 iframe 方式来加载下一页,无限套娃(适用于:部分动态加载内容的网站,需要允许 iframe 且支持通过 GET/POST 直接打开下一页) style: 加载 iframe 前要插入的 CSS Style 样式(比如为了悬浮的样式与下一页的重叠,隐藏网页底部间距提高阅读连续性) iframe: 这个必须加到 pager{} 外面(这样才会在该域名的 iframe 框架下运行脚本) 6 = 通过 iframe 获取下一页动态加载内容插入本页,只有一个娃(适用于:部分动态加载内容的网站,与上面不同的是,该模式适合简单的网页,没有复杂事件什么的) loadTime: 预留的网页加载时间,确保网页内容加载完成(省略后默认为 300ms) nextL: 下一页链接所在元素 pageE: 要从下一页获取的元素 insertP: 下一页元素插入本页的位置(数组第一个是基准元素,第二个是基准元素的前后具体位置) 1 = 插入基准元素自身的前面 2 = 插入基准元素内,第一个子元素前面 3 = 插入基准元素内,最后一个子元素后面 4 = 插入基准元素自身的后面 5 = 插入 pageE 列表最后一个元素的后面(该 insertP 可以直接省略不写,等同于 ['pageE', 5] ) 6 = 插入该元素自身内部末尾(针对小说网站等文本类的),附带参数 insertP6Br: true, 用来中间插入换行 // 小技巧:当基准元素是下一页主体元素的父元素时(或者说要将下一页元素插入到本页同元素最后一个后面时)是可以省略不写 insertP 例如:当 pageE: 'ul>li' 且 insertP: ['ul', 3] 时,实际等同于 ['ul>li', 5] 当 pageE: '.item' 且 insertP: ['.item', 4] 时,实际等同于 ['.item', 5] 当 pageE: '.item' 且 insertP: ['.page', 1] 时,实际等同于 ['.item', 5] 注意:如 pageE 中选择了多类元素,则不能省略 insertP(比如包含 `,` 与 `|` 符号),除非另外的选择器是