From 42aef2c9a542d7b912d9c47c637e213bb23f6bde Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 1 Jun 2024 14:39:28 +0800 Subject: [PATCH 001/502] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E7=BF=BB=E9=A1=B5?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F1=E5=92=8C3=E7=9A=84=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E6=96=B9=E5=BC=8F=20(=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E5=8E=9F=E7=94=9F=20XMLHttpRequest=20?= =?UTF-8?q?=E6=9D=A5=E8=A7=A3=E5=86=B3=E5=9B=A0=E7=BC=BA=E5=A4=B1=E8=B7=A8?= =?UTF-8?q?=E5=9F=9F=20cookie=20=E5=AF=BC=E8=87=B4=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=88=E6=AF=94=E5=A6=82=E4=B8=80=E4=BA=9B=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=20Cloudflare=20CDN=20=E4=BA=BA=E6=9C=BA=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E7=9A=84=E7=BD=91=E7=AB=99=EF=BC=8C=E4=BC=9A=E5=87=BA?= =?UTF-8?q?=E7=8E=B0=E8=84=9A=E6=9C=AC=E5=90=8E=E5=8F=B0=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=88=B0=E4=BA=BA=E6=9C=BA=E9=AA=8C=E8=AF=81=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=EF=BC=89)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Autopage.user.js | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/Autopage.user.js b/Autopage.user.js index 1d73cf4d9..019433a80 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -3,7 +3,7 @@ // @name:zh-CN 自动无缝翻页 // @name:zh-TW 自動無縫翻頁 // @name:en AutoPager -// @version 6.5.21 +// @version 6.6.0 // @author X.I.U // @description ⭐无缝加载 下一页内容 至网页底部(类似瀑布流)⭐,目前支持:【所有「Discuz!、Flarum、phpBB、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...) 等網站~ @@ -1867,7 +1867,37 @@ function: { // 翻页类型 1/3 function getPageE(url) { - GM_xmlhttpRequest({ + // 依靠原生 XMLHttpRequest 尝试解决因缺失跨域 cookie 导致的问题(比如一些使用 Cloudflare CDN 人机验证的网站,会出现脚本后台获取到人机验证页面) + const xhr = new XMLHttpRequest(); + xhr.open('GET', url, true); + xhr.overrideMimeType('text/html; charset=' + (document.characterSet||document.charset||document.inputEncoding)); + + if (curSite.xRequestedWith === true) {xhr.setRequestHeader('x-requested-with', 'XMLHttpRequest')} + (curSite.noReferer === true) ? xhr.setRequestHeader('Referer', ''):xhr.setRequestHeader('Referer', location.href) + xhr.setRequestHeader('User-Agent', navigator.userAgent) + xhr.setRequestHeader('Accept', 'text/html,application/xhtml+xml,application/xml') + + xhr.timeout = 10000; + xhr.onload = function() { + if (xhr.status >= 200 && xhr.status < 300) { + //console.log('URL:' + url, '最终 URL:' + xhr.responseURL, '返回内容:' + xhr.responseText) + processElems(createDocumentByString(xhr.responseText)); + } else { + console.error('[自动无缝翻页] - 处理获取到的下一页内容时出现问题,请检查!', xhr.statusText); + } + }; + xhr.onerror = function() { + console.log('URL:' + url, xhr.statusText) + GM_notification({text: '❌ 获取下一页失败...', timeout: 5000}); + }; + xhr.ontimeout = function() { + setTimeout(function(){curSite.pageUrl = '';}, 3000) + console.log('URL:' + url, xhr.statusText) + GM_notification({text: '❌ 获取下一页超时,可 3 秒后再次滚动网页重试(或尝试刷新网页)...', timeout: 5000}); + }; + xhr.send(); + + /*GM_xmlhttpRequest({ url: url, method: 'GET', overrideMimeType: 'text/html; charset=' + (document.characterSet||document.charset||document.inputEncoding), @@ -1895,7 +1925,7 @@ function: { console.log('URL:' + url, response) GM_notification({text: '❌ 获取下一页超时,可 3 秒后再次滚动网页重试(或尝试刷新网页)...', timeout: 5000}); } - }); + });*/ } // 翻页类型 4 function getPageE_(url, type = '', method = 'GET', data = '', type2) { From 4ccfb76d779decb0722feb4c1a6a66e9ed5cb4b5 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 1 Jun 2024 16:32:53 +0800 Subject: [PATCH 002/502] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E6=97=A0?= =?UTF-8?q?=E8=BF=BD=E6=90=9C=E7=B4=A2]=E3=80=81[nhentai]=20=E8=A7=84?= =?UTF-8?q?=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- other/Autopage/rules.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/other/Autopage/rules.json b/other/Autopage/rules.json index 19d91d04b..a5cdc17ec 100644 --- a/other/Autopage/rules.json +++ b/other/Autopage/rules.json @@ -120,7 +120,6 @@ "url": "if (fun.isMobile()) {return}; fun.isUrlC(); return (fun.lp() == '/s' && !fun.indexOF('a=image','s'))", "style": ".so-lazyimg{opacity: 1 !important;} .result {border: none !important;}", "history": true, - "noReferer": true, "pager": { "nextL": "#snext", "pageE": ".result,head>style", @@ -6034,12 +6033,12 @@ }, "nhentai": { "host": ["nhentai.net","nhentai.to","nhentai.xxx"], - "url": "return fun.getCSS('a.next, .current+a.page') && (fun.getCSS('.gallery, #image-container'))", + "url": "if (fun.indexOF(/^\\/g\\/\\d+\\/\\d+\\//)){const imageA = document.querySelector('#image-container>a'); imageA.outerHTML=imageA.innerHTML;return true;} else if (fun.getCSS('a.next') && fun.getCSS('.gallery')){return true;}", "style": "section#image-container img {max-width: 100% !important;height: auto !important;display: block !important;margin: 0 auto !important;}", "blank": 3, "pager": { "nextL": "a.next, .current+a.page", - "pageE": ".container>.gallery, .gallery-favorite, #image-container img", + "pageE": ".container>.gallery, #image-container img", "replaceE": ".pagination, .reader-pagination" }, "function": { From 9762aecc22480019fca651d1e3d5cd64e1832ad7 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 1 Jun 2024 16:34:27 +0800 Subject: [PATCH 003/502] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E4=B8=8A=E6=AC=A1?= =?UTF-8?q?=E6=94=B9=E5=8A=A8=E7=9A=84=E4=BB=A3=E7=A0=81=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=20=E8=84=9A=E6=9C=AC=E5=86=85=E7=BD=AE=E5=87=BD?= =?UTF-8?q?=E6=95=B0=20fun.pageNumIncrement()=20=E7=94=A8=E4=BA=8E?= =?UTF-8?q?=E5=9C=A8=E7=89=B9=E6=AE=8A=E8=A7=84=E5=88=99=E6=83=85=E5=86=B5?= =?UTF-8?q?=E4=B8=8B=E6=89=8B=E5=8A=A8=E9=80=92=E5=A2=9E=E5=B7=A6=E4=B8=8B?= =?UTF-8?q?=E8=A7=92=E7=9A=84=E9=A1=B5=E7=A0=81=E6=95=B0=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Autopage.user.js | 44 +++++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/Autopage.user.js b/Autopage.user.js index 019433a80..6dbeab0ba 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -3,7 +3,7 @@ // @name:zh-CN 自动无缝翻页 // @name:zh-TW 自動無縫翻頁 // @name:en AutoPager -// @version 6.6.0 +// @version 6.6.1 // @author X.I.U // @description ⭐无缝加载 下一页内容 至网页底部(类似瀑布流)⭐,目前支持:【所有「Discuz!、Flarum、phpBB、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...) 等網站~ @@ -126,7 +126,7 @@ loadMoreExclude1 = ['.smzdm.com','stackoverflow.com'], loadMoreExclude2 = ['.steampowered.com','.zcool.com.cn'], menuId = [], webType = 0, curSite = {SiteTypeID: 0}, DBSite, DBSite2, 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, 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} + window.autoPage = {lp: ()=>location.pathname, indexOF: indexOF, isMobile: isMobile, isUrlC: isUrlC, 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`;} if (_img) { getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中 - pageNum.now = pageNum._now + 1 + pageNumIncrement() } } @@ -1537,7 +1537,7 @@ function: { // 将 img 标签插入到网页中 getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), imanhuaw_getIMG()); addHistory(pageE); - pageNum.now = pageNum._now + 1 + pageNumIncrement() } @@ -1580,7 +1580,7 @@ function: { _img += `` } getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中 - pageNum.now = pageNum._now + 1 + pageNumIncrement() } @@ -1613,7 +1613,7 @@ function: { for (let i=1;i`;} getCSS(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); addHistory(pageE); - pageNum.now = pageNum._now + 1 + pageNumIncrement() } @@ -1658,7 +1658,7 @@ function: { // 插入