From 17e4a71dadac4aedff83055a9a049bd9bfeac462 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 5 Sep 2021 08:34:58 +0800 Subject: [PATCH 0001/1842] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[WindowsLatest]?= =?UTF-8?q?=E3=80=81[Winhelponline]=20=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Autopage.user.js | 48 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 41 insertions(+), 7 deletions(-) diff --git a/Autopage.user.js b/Autopage.user.js index 7be678661..2f99db662 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 自动无缝翻页 -// @version 2.1.5 +// @version 2.1.6 // @author X.I.U // @description 无缝拼接下一页内容(瀑布流),目前支持:[所有使用「Discuz!、Flarum、DUX(WordPress)」的网站]、百度、谷歌、必应、搜狗、头条、360、微信、贴吧、豆瓣、微博、NGA、V2EX、起点小说、煎蛋网、超能网、IT之家、千图网、Pixabay、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、小霸王其乐无穷、CS.RIN.RU、FitGirl、茶杯狐、NO视频、低端影视、奈菲影视、91美剧网、真不卡影院、片库、音范丝、BT之家、爱恋动漫、Nyaa、SrkBT、RARBG、SubHD、423Down、不死鸟、小众软件、极简插件、异次元软件、异星软件空间、动漫狂、漫画猫、漫画DB、HiComic、动漫之家、古风漫画网、PubMed、wikiHow、GreasyFork(以上仅一部分,更多的写不下了... // @match *://*/* @@ -329,10 +329,12 @@ baidu_tieba: { SiteTypeID: 0, host: 'tieba.baidu.com', - functionStart: function() {if (location.pathname === '/f') { // 帖子列表 + functionStart: function() {if (location.pathname === '/f') { baidu_tieba_1(); // 右侧悬浮发帖按钮点击事件(解决自动翻页导致无法发帖的问题) curSite = DBSite.baidu_tieba; document.lastElementChild.appendChild(document.createElement('style')).textContent = 'img.j_retract {margin-top: 0 !important;margin-bottom: 0 !important;}'; // 修复帖子列表中预览图片,在切换下一个/上一个图片时,多出来的图片上下边距 - } else if (location.pathname === '/f/search/res') { // 吧内搜索/全吧搜索 + //} else if (location.pathname.indexOf('/p/') > -1) { + //curSite = DBSite.baidu_tieba_post; + } else if (location.pathname === '/f/search/res') { curSite = DBSite.baidu_tieba_search; }}, pager: { @@ -365,9 +367,10 @@ pager: { type: 1, nextLink: '//a[@class="next"][@href]', - pageElement: 'css;.s_post_list > .s_post', - insertPosition: ['css;.s_post_list', 3], + pageElement: 'css;#j_p_postlist > *', + insertPosition: ['css;#j_p_postlist', 3], replaceE: 'css;.pager.pager-search', + scriptType: 1, scrollDelta: 1000 } }, // 百度贴吧 - 搜索页 @@ -1648,6 +1651,31 @@ before: lrepacks_functionBefore } }, + windowslatest: { + SiteTypeID: 0, + host: 'www.windowslatest.com', + pager: { + type: 1, + nextLink: '//div[contains(@class, "page-nav")]/a/i[@class="td-icon-menu-right"]/parent::a', + pageElement: 'css;.td-ss-main-content > div:not(.td-block-title-wrap):not(.page-nav)', + insertPosition: ['css;.page-nav', 1], + replaceE: 'css;.page-nav', + scrollDelta: 2000 + } + }, + winhelponline: { + SiteTypeID: 0, + host: 'www.winhelponline.com', + functionStart: function() {if (location.pathname === '/blog/') {curSite = DBSite.winhelponline;}}, + pager: { + type: 1, + nextLink: 'css;span.prev > a[href]', + pageElement: 'css;#main > article', + insertPosition: ['css;nav.paging-navigation', 1], + replaceE: 'css;nav.paging-navigation', + scrollDelta: 2000 + } + }, thewindowsclub: { SiteTypeID: 0, host: 'www.thewindowsclub.com', @@ -3275,7 +3303,7 @@ var newBody = ShowPager.createDocumentByString(response.responseText); let pageElems = getAllElements(curSite.pager.pageElement, newBody, newBody), toElement = getAllElements(curSite.pager.insertPosition[0])[0]; - //console.log(curSite.pager.pageElement, pageElems) + //console.log(curSite.pager.pageElement, pageElems, curSite.pager.insertPosition, toElement) if (pageElems.length >= 0) { // 如果有插入前函数就执行函数 @@ -3301,7 +3329,13 @@ let scriptText = ''; if (curSite.pager.scriptType === 1) { // 下一页的所有