From 9fd03a931d4009e8b84f9e3f4701dd40cba28a3d Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 26 Sep 2021 15:08:56 +0800 Subject: [PATCH 0001/1799] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20[=E4=B8=80?= =?UTF-8?q?=E9=94=AE=E6=94=B6=E8=B5=B7=E5=9B=9E=E7=AD=94]=20=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E9=A6=96=E9=A1=B5=E5=BC=82=E5=B8=B8=E6=94=B6=E8=B5=B7?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 50 ++++++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 21 deletions(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index cde5eb49f..c8b71555c 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎增强 -// @version 1.7.5 +// @version 1.7.6 // @author X.I.U // @description 移除登录弹窗、默认收起回答、一键收起回答、收起当前回答/评论(点击两侧空白处)、快捷回到顶部(右键两侧空白处)、屏蔽用户 (发布的内容)、屏蔽关键词(标题/评论)、屏蔽指定类别(视频/文章等)、屏蔽盐选内容、净化标题消息、展开问题描述、置顶显示时间、完整问题时间、区分问题文章、直达问题按钮、默认高清原图、默认站外直链 // @match *://www.zhihu.com/* @@ -194,29 +194,37 @@ function collapsedAnswer() { document.head.appendChild(document.createElement('style')).textContent = '.CornerButton{margin-bottom:8px !important;}.CornerButtons{bottom:45px !important;}'; document.querySelector('.CornerAnimayedFlex').insertAdjacentHTML('afterBegin', ''); document.getElementById('collapsed-button').onclick = function () { - document.querySelectorAll('[script-collapsed]').forEach(function(scriptCollapsed) { - scriptCollapsed.querySelectorAll('.ContentItem-actions [data-zop-retract-question], .ContentItem-actions.Sticky [data-zop-retract-question]').forEach(function(button) { + if (location.pathname === '/' || location.pathname === '/hot' || location.pathname === '/follow') { + document.querySelectorAll('.ContentItem-rightButton').forEach(function (el) { + if (el.hasAttribute('data-zop-retract-question')) { + el.click() + } + }); + } else { + document.querySelectorAll('[script-collapsed]').forEach(function(scriptCollapsed) { + scriptCollapsed.querySelectorAll('.ContentItem-actions [data-zop-retract-question], .ContentItem-actions.Sticky [data-zop-retract-question]').forEach(function(button) { + button.click(); + }) + }) + document.querySelectorAll('.RichContent:not([script-collapsed]) .ContentItem-actions.Sticky [data-zop-retract-question]').forEach(function(button) { + let el = button.parentElement; + while (!el.classList.contains('RichContent')) { + el = el.parentElement; + } + if (el) { + el.setAttribute('script-collapsed', ''); + } button.click(); }) - }) - document.querySelectorAll('.RichContent:not([script-collapsed]) .ContentItem-actions.Sticky [data-zop-retract-question]').forEach(function(button) { - let el = button.parentElement; - while (!el.classList.contains('RichContent')) { - el = el.parentElement; - } - if (el) { - el.setAttribute('script-collapsed', ''); + const observer = getCollapsedAnswerObserver(); + observer.start(); + if (!menu_value('menu_defaultCollapsedAnswer') && !observer._disconnectListener) { + window.addEventListener('locationchange', function() { + observer.end(); + window._collapsedAnswerObserver = null; + }) + observer._disconnectListener = true; } - button.click(); - }) - const observer = getCollapsedAnswerObserver(); - observer.start(); - if (!menu_value('menu_defaultCollapsedAnswer') && !observer._disconnectListener) { - window.addEventListener('locationchange', function() { - observer.end(); - window._collapsedAnswerObserver = null; - }) - observer._disconnectListener = true; } } } From 2fcd0a837098b3a855810b8d9e264743d12c4ca8 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 26 Sep 2021 15:25:23 +0800 Subject: [PATCH 0002/1799] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[Github=20Pull?= =?UTF-8?q?=20requests=E3=80=81Discussions]=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 | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/Autopage.user.js b/Autopage.user.js index 61ab1bdc2..188e1848c 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 自动无缝翻页 -// @version 2.5.1 +// @version 2.5.2 // @author X.I.U // @description 无缝拼接下一页内容(瀑布流),目前支持:[所有使用「Discuz!、Flarum、DUX(WordPress)」的网站]、百度、谷歌、必应、搜狗、头条、360、微信、贴吧、豆瓣、微博、NGA、V2EX、龙的天空、起点小说、煎蛋网、IT之家、千图网、Pixabay、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、小霸王其乐无穷、CS.RIN.RU、FitGirl、茶杯狐、NO视频、低端影视、奈菲影视、91美剧网、真不卡影院、片库、音范丝、BT之家、萌番组、动漫花园、樱花动漫、爱恋动漫、AGE 动漫、Nyaa、SrkBT、RARBG、SubHD、423Down、不死鸟、扩展迷、极简插件、小众软件、动漫狂、漫画猫、漫画DB、HiComic、动漫之家、古风漫画网、PubMed、wikiHow、GreasyFork、Github、StackOverflow(以上仅一部分,更多的写不下了... // @match *://*/* @@ -2410,9 +2410,10 @@ functionStart: function() {locationchange = true; if (location.search.indexOf('tab=stars') > -1) { curSite = DBSite.github_star; - } else if (location.pathname.indexOf('/issues') > -1 && location.pathname.indexOf('/issues/') === -1) { + } else if ((location.pathname.indexOf('/issues') > -1 && location.pathname.indexOf('/issues/') === -1) || (location.pathname.indexOf('/pulls') > -1 && location.pathname.indexOf('/pulls/') === -1)) { curSite = DBSite.github_issues; - console.log(1111111111) + } else if (location.pathname.indexOf('/discussions') > -1 && !(/\/discussions\/\d+/.test(location.pathname))) { + curSite = DBSite.github_discussions; } else if (location.pathname === '/search') { if (!location.search) return if (location.search.indexOf('type=Repositories') > -1 || location.search.indexOf('type=') === -1) { @@ -2454,7 +2455,18 @@ replaceE: 'css;.pagination', scrollDelta: 3000 } - }, // Github - Issues 列表 + }, // Github - Issues 列表 / PR 列表 + github_discussions: { + SiteTypeID: 0, + pager: { + type: 1, + nextLink: 'css;a.next_page', + pageElement: 'css;#repo-content-pjax-container div[data-discussion-hovercards-enabled] > div', + insertPosition: ['css;#repo-content-pjax-container div[data-discussion-hovercards-enabled]', 3], + replaceE: 'css;.pagination', + scrollDelta: 3000 + } + }, // Github - Discussions 列表 github_search: { SiteTypeID: 0, pager: { From aa2bf201aab9b356b898b5e8c8ae5d7e5444f6a4 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 26 Sep 2021 15:53:20 +0800 Subject: [PATCH 0003/1799] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[DuckDuckGo]=20?= =?UTF-8?q?=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Autopage.user.js | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/Autopage.user.js b/Autopage.user.js index 188e1848c..f763419d4 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 自动无缝翻页 -// @version 2.5.2 +// @version 2.5.3 // @author X.I.U -// @description 无缝拼接下一页内容(瀑布流),目前支持:[所有使用「Discuz!、Flarum、DUX(WordPress)」的网站]、百度、谷歌、必应、搜狗、头条、360、微信、贴吧、豆瓣、微博、NGA、V2EX、龙的天空、起点小说、煎蛋网、IT之家、千图网、Pixabay、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、小霸王其乐无穷、CS.RIN.RU、FitGirl、茶杯狐、NO视频、低端影视、奈菲影视、91美剧网、真不卡影院、片库、音范丝、BT之家、萌番组、动漫花园、樱花动漫、爱恋动漫、AGE 动漫、Nyaa、SrkBT、RARBG、SubHD、423Down、不死鸟、扩展迷、极简插件、小众软件、动漫狂、漫画猫、漫画DB、HiComic、动漫之家、古风漫画网、PubMed、wikiHow、GreasyFork、Github、StackOverflow(以上仅一部分,更多的写不下了... +// @description 无缝拼接下一页内容(瀑布流),目前支持:[所有使用「Discuz!、Flarum、DUX(WordPress)」的网站]、百度、谷歌、必应、搜狗、头条搜索、360 搜索、微信搜索、贴吧、豆瓣、微博、NGA、V2EX、龙的天空、起点小说、煎蛋网、IT之家、千图网、Pixabay、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、小霸王其乐无穷、CS.RIN.RU、FitGirl、茶杯狐、NO视频、低端影视、奈菲影视、91美剧网、真不卡影院、片库、音范丝、BT之家、萌番组、动漫花园、樱花动漫、爱恋动漫、AGE 动漫、Nyaa、SrkBT、RARBG、SubHD、423Down、不死鸟、扩展迷、极简插件、小众软件、动漫狂、漫画猫、漫画DB、HiComic、动漫之家、古风漫画网、PubMed、wikiHow、GreasyFork、Github、StackOverflow(以上仅一部分,更多的写不下了... // @match *://*/* // @connect www.gamersky.com // @icon https://i.loli.net/2021/03/07/rdijeYm83pznxWq.png @@ -220,7 +220,7 @@ replaceE: 'css;#page', scrollDelta: 1200 } - }, // 百度搜素 + }, // 百度 搜素 google: { SiteTypeID: 0, host: /.google./, @@ -234,7 +234,7 @@ scriptType: 1, scrollDelta: 3000 } - }, // 谷歌搜索 + }, // 谷歌 搜索 bing: { SiteTypeID: 0, host: ['www.bing.com','cn.bing.com'], @@ -247,7 +247,7 @@ replaceE: 'css;#b_results > .b_pag', scrollDelta: 1500 } - }, // 必应搜索 + }, // 必应 搜索 yandex: { SiteTypeID: 0, host: 'yandex.com', @@ -276,7 +276,7 @@ function: { before: toutiao_functionBefore } - }, // 头条搜索 + }, // 头条 搜索 sogou: { SiteTypeID: 0, host: 'www.sogou.com', @@ -290,7 +290,7 @@ scriptType: 4, scrollDelta: 1200 } - }, // 搜狗搜索 + }, // 搜狗 搜索 sogou_weixin: { SiteTypeID: 0, host: 'weixin.sogou.com', @@ -343,7 +343,17 @@ nextText: '加载更多', scrollDelta: 1500 } - }, // Magi搜索 + }, // Magi 搜索 + duckduckgo: { + SiteTypeID: 0, + host: 'duckduckgo.com', + functionStart: function() { + if (getCookie('av') != '1') { + document.cookie='av=1; expires=Thu, 18 Dec 2031 12:00:00 GMT; path=/'; // 写入 Cookie 强制开启自带的无缝翻页功能 + location.reload(); // 刷新网页 + } + }, + }, // DuckDuckGo 搜索 baidu_tieba: { SiteTypeID: 0, host: 'tieba.baidu.com', From 3404b242e38d47b0a1d4eb6d61c02b52638f8b8f Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 26 Sep 2021 16:37:58 +0800 Subject: [PATCH 0004/1799] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[233=20=E5=8A=A8?= =?UTF-8?q?=E6=BC=AB]=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 | 45 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/Autopage.user.js b/Autopage.user.js index f763419d4..eb20998e3 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 自动无缝翻页 -// @version 2.5.3 +// @version 2.5.4 // @author X.I.U -// @description 无缝拼接下一页内容(瀑布流),目前支持:[所有使用「Discuz!、Flarum、DUX(WordPress)」的网站]、百度、谷歌、必应、搜狗、头条搜索、360 搜索、微信搜索、贴吧、豆瓣、微博、NGA、V2EX、龙的天空、起点小说、煎蛋网、IT之家、千图网、Pixabay、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、小霸王其乐无穷、CS.RIN.RU、FitGirl、茶杯狐、NO视频、低端影视、奈菲影视、91美剧网、真不卡影院、片库、音范丝、BT之家、萌番组、动漫花园、樱花动漫、爱恋动漫、AGE 动漫、Nyaa、SrkBT、RARBG、SubHD、423Down、不死鸟、扩展迷、极简插件、小众软件、动漫狂、漫画猫、漫画DB、HiComic、动漫之家、古风漫画网、PubMed、wikiHow、GreasyFork、Github、StackOverflow(以上仅一部分,更多的写不下了... +// @description 无缝拼接下一页内容(瀑布流),目前支持:[所有使用「Discuz!、Flarum、DUX(WordPress)」的网站]、百度、谷歌、必应、搜狗、头条搜索、360 搜索、微信搜索、贴吧、豆瓣、微博、NGA、V2EX、龙的天空、起点小说、煎蛋网、IT之家、千图网、Pixabay、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、CS.RIN.RU、FitGirl、片库、茶杯狐、NO视频、低端影视、奈菲影视、91美剧网、真不卡影院、音范丝、BT之家、萌番组、动漫花园、樱花动漫、爱恋动漫、AGE 动漫、Nyaa、SrkBT、RARBG、SubHD、423Down、不死鸟、扩展迷、极简插件、小众软件、动漫狂、漫画猫、漫画DB、HiComic、动漫之家、古风漫画网、PubMed、wikiHow、GreasyFork、Github、StackOverflow(以上仅一部分,更多的写不下了... // @match *://*/* // @connect www.gamersky.com // @icon https://i.loli.net/2021/03/07/rdijeYm83pznxWq.png @@ -1342,6 +1342,47 @@ before: src_original_functionBefore } }, // 91 美剧网 + dm233: { + SiteTypeID: 0, + host: 'www.dm233.cc', + functionStart: function() {if (location.pathname.indexOf('/catalog/') > -1 || location.pathname === '/recommend/' || location.pathname === '/search') { + curSite = DBSite.dm233; + } else if (location.pathname === '/article/') { + curSite = DBSite.dm233_article; + } else if (location.pathname === '/rank/') { + curSite = DBSite.dm233_rank; + }}, + pager: { + type: 1, + nextLink: '//div[@class="pagelist"]//a[contains(text(), "下一页") or contains(text(), "下一頁")]', + pageElement: 'css;.dhnew ul > li', + insertPosition: ['css;.dhnew ul', 3], + replaceE: 'css;.pagelist', + scrollDelta: 1000 + } + }, // 233 动漫 + dm233_article: { + SiteTypeID: 0, + pager: { + type: 1, + nextLink: '//div[@class="pagelist"]//a[contains(text(), "下一页") or contains(text(), "下一頁")]', + pageElement: 'css;.xgyd ul > li', + insertPosition: ['css;.xgyd ul', 3], + replaceE: 'css;.pagelist', + scrollDelta: 1000 + } + }, // 233 动漫 - 动漫情报/资讯 + dm233_rank: { + SiteTypeID: 0, + pager: { + type: 1, + nextLink: '//div[@class="pagelist"]//a[contains(text(), "下一页") or contains(text(), "下一頁")]', + pageElement: 'css;.side-update.normal-wai > .normal-nei', + insertPosition: ['css;.side-update.normal-wai', 3], + replaceE: 'css;.pagelist', + scrollDelta: 1000 + } + }, // 233 动漫 - 排行榜 agefans: { SiteTypeID: 0, host: 'www.agefans.cc', From 803b897a359cc319cff3261743963678075598b3 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 26 Sep 2021 20:59:31 +0800 Subject: [PATCH 0005/1799] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20description?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index c8b71555c..4b5815380 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -2,7 +2,7 @@ // @name 知乎增强 // @version 1.7.6 // @author X.I.U -// @description 移除登录弹窗、默认收起回答、一键收起回答、收起当前回答/评论(点击两侧空白处)、快捷回到顶部(右键两侧空白处)、屏蔽用户 (发布的内容)、屏蔽关键词(标题/评论)、屏蔽指定类别(视频/文章等)、屏蔽盐选内容、净化标题消息、展开问题描述、置顶显示时间、完整问题时间、区分问题文章、直达问题按钮、默认高清原图、默认站外直链 +// @description 移除登录弹窗、默认收起回答、一键收起回答、收起当前回答/评论(点击两侧空白处)、快捷回到顶部(右键两侧空白处)、屏蔽用户 (发布的内容)、屏蔽关键词(标题/评论)、屏蔽首页视频(视频/文章等类别)、屏蔽盐选内容、净化标题消息、展开问题描述、置顶显示时间、完整问题时间、区分问题文章、直达问题按钮、默认高清原图、默认站外直链 // @match *://www.zhihu.com/* // @match *://zhuanlan.zhihu.com/* // @icon https://static.zhihu.com/heifetz/favicon.ico From e63f3d3b3a9146600a4e13565e5bdda74c5d1679 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 27 Sep 2021 09:37:03 +0800 Subject: [PATCH 0006/1799] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E8=B0=B7?= =?UTF-8?q?=E6=AD=8C=E5=AD=A6=E6=9C=AF]=20=E6=94=AF=E6=8C=81;=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=20[Github=20=E6=90=9C=E7=B4=A2=E9=A1=B5]=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 --- Autopage.user.js | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/Autopage.user.js b/Autopage.user.js index eb20998e3..436f60e85 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 自动无缝翻页 -// @version 2.5.4 +// @version 2.5.5 // @author X.I.U // @description 无缝拼接下一页内容(瀑布流),目前支持:[所有使用「Discuz!、Flarum、DUX(WordPress)」的网站]、百度、谷歌、必应、搜狗、头条搜索、360 搜索、微信搜索、贴吧、豆瓣、微博、NGA、V2EX、龙的天空、起点小说、煎蛋网、IT之家、千图网、Pixabay、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、CS.RIN.RU、FitGirl、片库、茶杯狐、NO视频、低端影视、奈菲影视、91美剧网、真不卡影院、音范丝、BT之家、萌番组、动漫花园、樱花动漫、爱恋动漫、AGE 动漫、Nyaa、SrkBT、RARBG、SubHD、423Down、不死鸟、扩展迷、极简插件、小众软件、动漫狂、漫画猫、漫画DB、HiComic、动漫之家、古风漫画网、PubMed、wikiHow、GreasyFork、Github、StackOverflow(以上仅一部分,更多的写不下了... // @match *://*/* @@ -224,7 +224,11 @@ google: { SiteTypeID: 0, host: /.google./, - functionStart: function() {if (location.pathname === '/search') curSite = DBSite.google;}, + functionStart: function() {if (location.pathname === '/search') { + curSite = DBSite.google; + } else if (location.pathname === '/scholar') { + curSite = DBSite.google_scholar; + }}, pager: { type: 1, nextLink: 'id("pnnext")[@href]', @@ -235,6 +239,18 @@ scrollDelta: 3000 } }, // 谷歌 搜索 + google_scholar: { + SiteTypeID: 0, + pager: { + type: 1, + nextLink: '//a[./span[@class="gs_ico gs_ico_nav_next"]]', + pageElement: 'css;#gs_res_ccl_mid > *', + insertPosition: ['css;#gs_res_ccl_mid', 3], + replaceE: 'id("gs_n")', + scriptType: 1, + scrollDelta: 2000 + } + }, // 谷歌学术 搜索 bing: { SiteTypeID: 0, host: ['www.bing.com','cn.bing.com'], @@ -1236,7 +1252,7 @@ function: { before: pianku_functionBefore } - }, // 片库 + }, // 片库 cupfox: { SiteTypeID: 0, host: 'www.cupfox.com', @@ -1360,7 +1376,7 @@ replaceE: 'css;.pagelist', scrollDelta: 1000 } - }, // 233 动漫 + }, // 233 动漫 dm233_article: { SiteTypeID: 0, pager: { @@ -1371,7 +1387,7 @@ replaceE: 'css;.pagelist', scrollDelta: 1000 } - }, // 233 动漫 - 动漫情报/资讯 + }, // 233 动漫 - 动漫情报/资讯 dm233_rank: { SiteTypeID: 0, pager: { @@ -1382,7 +1398,7 @@ replaceE: 'css;.pagelist', scrollDelta: 1000 } - }, // 233 动漫 - 排行榜 + }, // 233 动漫 - 排行榜 agefans: { SiteTypeID: 0, host: 'www.agefans.cc', @@ -2465,7 +2481,7 @@ curSite = DBSite.github_issues; } else if (location.pathname.indexOf('/discussions') > -1 && !(/\/discussions\/\d+/.test(location.pathname))) { curSite = DBSite.github_discussions; - } else if (location.pathname === '/search') { + } else if (location.pathname.indexOf('/search') > -1) { if (!location.search) return if (location.search.indexOf('type=Repositories') > -1 || location.search.indexOf('type=') === -1) { curSite = DBSite.github_search; From 62196220fdbb1dcde80544e15bb19fe864feb55d Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 27 Sep 2021 16:25:56 +0800 Subject: [PATCH 0007/1799] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[Mangabz=20?= =?UTF-8?q?=E6=BC=AB=E7=94=BB]=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 | 113 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 111 insertions(+), 2 deletions(-) diff --git a/Autopage.user.js b/Autopage.user.js index 436f60e85..4f1ea0b84 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 自动无缝翻页 -// @version 2.5.5 +// @version 2.5.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之家、萌番组、动漫花园、樱花动漫、爱恋动漫、AGE 动漫、Nyaa、SrkBT、RARBG、SubHD、423Down、不死鸟、扩展迷、极简插件、小众软件、动漫狂、漫画猫、漫画DB、HiComic、动漫之家、古风漫画网、PubMed、wikiHow、GreasyFork、Github、StackOverflow(以上仅一部分,更多的写不下了... // @match *://*/* @@ -2441,6 +2441,39 @@ before: szcdmj_functionBefore } }, // 砂之船动漫家 + mangabz: { + SiteTypeID: 0, + host: 'mangabz.com', + functionStart: function() {if (/\/m\d+/.test(location.pathname)) { + setTimeout(mangabz_init, 500); + curSite = DBSite.mangabz; + document.lastElementChild.appendChild(document.createElement('style')).textContent = 'body > .container > div:not([id]) {display: none !important;} .top-bar {opacity: 0.3 !important;} #cp_img > img{display: block !important;margin: 0 auto !important;width: auto !important; height: auto !important;}'; + } else if (/\/\d+bz\//.test(location.pathname)) { + if (document.querySelector('.detail-list-form-more')) document.querySelector('.detail-list-form-more').click(); + } else if (location.pathname.indexOf('/manga-list') > -1 || location.pathname === '/search') { + curSite = DBSite.mangabz_list; + }}, + pager: { + type: 4, + nextLink: mangabz_functionNext, + insertPosition: ['css;#cp_img', 3], + insertElement: mangabz_insertElement, + replaceE: 'css;p.top-title, body > .container > div:not([id]), title', + intervals: 500, + scrollDelta: 1000 + } + }, // Mangabz 漫画 + mangabz_list: { + SiteTypeID: 0, + pager: { + type: 1, + nextLink: '//div[@class="page-pagination"]//a[@href][contains(text(), ">")]', + pageElement: 'css;ul.mh-list > li', + insertPosition: ['css;ul.mh-list', 3], + replaceE: 'css;.page-pagination', + scrollDelta: 800 + } + }, // Mangabz 漫画 - 分类/搜索页 netbian: { SiteTypeID: 0, host: 'pic.netbian.com', @@ -3884,6 +3917,79 @@ } + // [Mangabz 漫画] 初始化(调整本话图片) + function mangabz_init() { + pageNumber('del'); + let showimage = document.getElementById('showimage'), + cp_img = document.getElementById('cp_img'), + cp_image = document.getElementById('cp_image'); + if (showimage) {showimage.removeAttribute('oncontextmenu');} + if (cp_img) {cp_img.removeAttribute('oncontextmenu');} + if (cp_image) { + cp_image.removeAttribute('oncontextmenu'); + cp_image.removeAttribute('id'); + cp_image.removeAttribute('style'); + } + } + // [Mangabz 漫画] 获取下一页地址 + function mangabz_functionNext() { + var url = ''; + if (MANGABZ_PAGE === MANGABZ_IMAGE_COUNT) { // 下一话 + url = getElementByXpath('//a[./img[contains(@src, "icon_xiayizhang")]]') + if (url === curSite.pageUrl) return + curSite.pageUrl = url + //console.log(curSite.pageUrl) + getPageElems(curSite.pageUrl); // 访问下一话 URL 获取 + } else { // 下一页 + if (!mkey) var mkey = ''; + url = location.origin + location.pathname + 'chapterimage.ashx' + `?cid=${MANGABZ_CID}&page=${MANGABZ_PAGE + 1}&key=${(mkey)}&_cid=${MANGABZ_CID}&_mid=${MANGABZ_MID}&_dt=${MANGABZ_VIEWSIGN_DT}&_sign=${MANGABZ_VIEWSIGN}` + if (url === curSite.pageUrl) return + curSite.pageUrl = url + //console.log(curSite.pageUrl) + getPageElems(curSite.pageUrl, 'text', 'GET', '', 'Next'); // 访问下一页 URL 获取 + } + } + // [Mangabz 漫画] 插入数据 + function mangabz_insertElement(pageElems, type) { + if (pageElems) { + if (type === 'Next') { + let imgArr = eval(pageElems), + _img = ''; + for (let now of imgArr) { + _img += ``; + } + if (_img) { + document.querySelector(curSite.pager.insertPosition[0].replace('css;', '')).insertAdjacentHTML(addTo(curSite.pager.insertPosition[1]), _img); // 将 img 标签插入到网页中 + + // 添加历史记录 + MANGABZ_PAGE += imgArr.length; + window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, document.title, location.origin + MANGABZ_CURL.substring(0, MANGABZ_CURL.length - 1) + '-p' + MANGABZ_PAGE + '/'); + } + } else { + // 插入