From bf7e59938edc3131ff5dea736a2f0e0e363d74b2 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 16 Aug 2021 13:37:23 +0800 Subject: [PATCH 0001/1967] README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5f8b6fb50..ae8a06fb3 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # XIU2/UserScript -[![GitHub license](https://img.shields.io/github/license/XIU2/UserScript.svg?style=flat-square&color=4285dd)](https://github.com/XIU2/UserScript/blob/master/LICENSE) -[![GitHub Star](https://img.shields.io/github/stars/XIU2/UserScript.svg?style=flat-square&label=Star&color=4285dd)](https://github.com/XIU2/UserScript/stargazers) -[![GitHub Fork](https://img.shields.io/github/forks/XIU2/UserScript.svg?style=flat-square&label=Fork&color=4285dd)](https://github.com/XIU2/UserScript/network/members) +[![GitHub license](https://img.shields.io/github/license/XIU2/UserScript.svg?style=flat-square&color=4285dd&logo=github)](https://github.com/XIU2/UserScript/) +[![GitHub Star](https://img.shields.io/github/stars/XIU2/UserScript.svg?style=flat-square&label=Star&color=4285dd&logo=github)](https://github.com/XIU2/UserScript/) +[![GitHub Fork](https://img.shields.io/github/forks/XIU2/UserScript.svg?style=flat-square&label=Fork&color=4285dd&logo=github)](https://github.com/XIU2/UserScript/) [![](https://img.shields.io/static/v1?label=%20&message=GreasyFork&style=flat-square&labelColor=7B0000&color=960000&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3ggEBCQHM3fXsAAAAVdJREFUOMudkz2qwkAUhc/goBaGJBgUtBCZyj0ILkpwAW7Bws4yO3AHLiCtEFD8KVREkoiFxZzX5A2KGfN4F04zMN+ce+5c4LMUgDmANYBnrnV+plBSi+FwyHq9TgA2LQpvCiEiABwMBtzv95RSfoNEHy8DYBzHrNVqVEr9BWKcqNFoxF6vx3a7zc1mYyC73a4MogBg7vs+z+czO50OW60Wt9stK5UKp9Mpj8cjq9WqDTBHnjAdxzGQZrPJw+HA31oulzbAWgLoA0CWZVBKIY5jzGYzdLtdE9DlcrFNrY98zobqOA6TJKHW2jg4nU5sNBpFDp6mhVe5rsvVasUwDHm9Xqm15u12o+/7Hy0gD8KatOd5vN/v1FozTVN6nkchxFuI6hsAAIMg4OPxMJCXdtTbR7JJCMEgCJhlGUlyPB4XfumozInrupxMJpRSRtZlKoNYl+m/6/wDuWAjtPfsQuwAAAAASUVORK5CYII=)](https://greasyfork.org/zh-CN/users/457025-x-i-u) 🔨 自用的一些乱七八糟油猴脚本,**有什么需求、建议、问题直接提 [Issues](https://github.com/XIU2/UserScript/issues/new/choose)**,觉得**好用请点个⭐鼓励一下下~** From 862bede892e4be1408f3f40e5b61f79cf115237b Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 16 Aug 2021 13:37:48 +0800 Subject: [PATCH 0002/1967] =?UTF-8?q?=E6=8E=92=E9=99=A4=20Safari=20?= =?UTF-8?q?=E6=B5=8F=E8=A7=88=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Beautification.user.js | 1 + Zhihu-Enhanced.user.js | 1 + 2 files changed, 2 insertions(+) diff --git a/Zhihu-Beautification.user.js b/Zhihu-Beautification.user.js index efbde2988..d266fba72 100644 --- a/Zhihu-Beautification.user.js +++ b/Zhihu-Beautification.user.js @@ -14,6 +14,7 @@ // @grant GM_notification // @license GPL-3.0 License // @run-at document-start +// @incompatible safari // @namespace https://greasyfork.org/scripts/412212 // @supportURL https://github.com/XIU2/UserScript // @homepageURL https://github.com/XIU2/UserScript diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 21cede5d2..931fb89e0 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -16,6 +16,7 @@ // @grant GM_info // @license GPL-3.0 License // @run-at document-end +// @incompatible safari // @namespace https://greasyfork.org/scripts/4122051 // @supportURL https://github.com/XIU2/UserScript // @homepageURL https://github.com/XIU2/UserScript From e1a70ffbc32f4a6a41d35ae65ec8d9fa09687a63 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 16 Aug 2021 16:26:18 +0800 Subject: [PATCH 0003/1967] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E7=9B=B4?= =?UTF-8?q?=E8=BE=BE=E9=97=AE=E9=A2=98=E6=8C=89=E9=92=AE]=20=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E5=8F=8A=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 931fb89e0..143e91e67 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎增强 -// @version 1.6.3 +// @version 1.6.4 // @author X.I.U // @description 移除登录弹窗、默认收起回答、一键收起回答、收起当前回答/评论(点击两侧空白处)、快捷回到顶部(右键两侧空白处)、屏蔽用户 (发布的内容)、屏蔽关键词(标题/评论)、屏蔽盐选内容、展开问题描述、置顶显示时间、显示问题时间、区分问题文章、直达问题按钮、默认高清原图、默认站外直链 // @match *://www.zhihu.com/* @@ -927,13 +927,12 @@ function addTypeTips() { function addToQuestion() { if (!menu_value('menu_toQuestion')) return - // 添加按钮样式 - document.lastChild.appendChild(document.createElement('style')).textContent = `svg.zhihu_e_toQuestion {-webkit-transform: rotate(270deg);transform: rotate(270deg);} a.zhihu_e_toQuestion {font-size: 14px;font-weight: normal;padding: 3px 5px;margin-left: 3px;border-radius: 3px;}`; - - // 一开始加载的信息流 + // 一开始加载的信息流 + 添加按钮样式 if (location.pathname === '/search') { + document.lastChild.appendChild(document.createElement('style')).textContent = `a.zhihu_e_toQuestion {font-size: 14px !important;font-weight: normal !important;padding: 0 6px 2px !important;border-radius: 3px !important;display: inline-block !important;vertical-align: top !important;height: 23px !important;}`; addSetInterval_('h2.ContentItem-title a:not(.zhihu_e_tips)'); } else { + document.lastChild.appendChild(document.createElement('style')).textContent = `a.zhihu_e_toQuestion {font-size: 14px !important;font-weight: normal !important;padding: 2px 6px !important;border-radius: 3px !important;display: inline-block !important;vertical-align: top !important;}`; document.querySelectorAll('h2.ContentItem-title a:not(.zhihu_e_tips)').forEach(function(item){addTypeTips_(item);}) } @@ -955,8 +954,11 @@ function addToQuestion() { function addTypeTips_(titleA) { if (!titleA) return // 判断是否为真 if (titleA.parentElement.querySelector('a.zhihu_e_toQuestion')) return // 判断是否已添加 + if (titleA.textContent.indexOf('?') != -1) { // 把问题末尾英文问好 [?] 的替换为中文问好 [?],这样按钮与标题之间的间距就刚刚好~ + titleA.innerHTML = titleA.innerHTML.replace('?', "?") + } if (/answer\/\d+/.test(titleA.href)) { // 如果是指向回答的问题(而非指向纯问题的链接) - titleA.insertAdjacentHTML('afterend', `直达问题`); + titleA.insertAdjacentHTML('afterend', `直达问题`); } } From 4cfea6ba1151a7d9fbab42a8b38009c773594e41 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 16 Aug 2021 17:47:16 +0800 Subject: [PATCH 0004/1967] =?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 143e91e67..2d33aee9c 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -2,7 +2,7 @@ // @name 知乎增强 // @version 1.6.4 // @author X.I.U -// @description 移除登录弹窗、默认收起回答、一键收起回答、收起当前回答/评论(点击两侧空白处)、快捷回到顶部(右键两侧空白处)、屏蔽用户 (发布的内容)、屏蔽关键词(标题/评论)、屏蔽盐选内容、展开问题描述、置顶显示时间、显示问题时间、区分问题文章、直达问题按钮、默认高清原图、默认站外直链 +// @description 移除登录弹窗、默认收起回答、一键收起回答、收起当前回答/评论(点击两侧空白处)、快捷回到顶部(右键两侧空白处)、屏蔽用户 (发布的内容)、屏蔽关键词(标题/评论)、屏蔽盐选内容、展开问题描述、置顶显示时间、完整问题时间、区分问题文章、直达问题按钮、默认高清原图、默认站外直链 // @match *://www.zhihu.com/* // @match *://zhuanlan.zhihu.com/* // @icon https://static.zhihu.com/heifetz/favicon.ico From 715ac4bbc2350139f5fdf12aa3425d741127a0b5 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 16 Aug 2021 20:58:43 +0800 Subject: [PATCH 0005/1967] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E5=8C=BA?= =?UTF-8?q?=E5=88=86=E9=97=AE=E9=A2=98=E6=96=87=E7=AB=A0]=E3=80=81[?= =?UTF-8?q?=E7=9B=B4=E8=BE=BE=E9=97=AE=E9=A2=98=E6=8C=89=E9=92=AE]=20?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 2d33aee9c..32c0c8fed 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎增强 -// @version 1.6.4 +// @version 1.6.5 // @author X.I.U // @description 移除登录弹窗、默认收起回答、一键收起回答、收起当前回答/评论(点击两侧空白处)、快捷回到顶部(右键两侧空白处)、屏蔽用户 (发布的内容)、屏蔽关键词(标题/评论)、屏蔽盐选内容、展开问题描述、置顶显示时间、完整问题时间、区分问题文章、直达问题按钮、默认高清原图、默认站外直链 // @match *://www.zhihu.com/* @@ -854,13 +854,12 @@ function blockYanXuan() { function addTypeTips() { if (!menu_value('menu_typeTips')) return - // 添加标签样式 - document.lastChild.appendChild(document.createElement('style')).textContent = `small.zhihu_e_tips {font-weight: bold;font-size: 13px;padding: 0 4px;border-radius: 2px;display: inline-block;height: 20px;}`; - - // 一开始加载的信息流 + // 一开始加载的信息流 + 添加标签样式 if (location.pathname === '/search') { + document.lastChild.appendChild(document.createElement('style')).textContent = `small.zhihu_e_tips {font-weight: bold;font-size: 13px;padding: 1px 4px 0;border-radius: 2px;display: inline-block;vertical-align: top;margin-top: 2px;}`; addSetInterval_('h2.ContentItem-title a:not(.zhihu_e_toQuestion)'); } else { + document.lastChild.appendChild(document.createElement('style')).textContent = `small.zhihu_e_tips {font-weight: bold;font-size: 13px;padding: 1px 4px 0;border-radius: 2px;display: inline-block;vertical-align: top;margin-top: 4px;}`; document.querySelectorAll('h2.ContentItem-title a:not(.zhihu_e_toQuestion)').forEach(function(item){addTypeTips_(item);}) } @@ -929,10 +928,10 @@ function addToQuestion() { // 一开始加载的信息流 + 添加按钮样式 if (location.pathname === '/search') { - document.lastChild.appendChild(document.createElement('style')).textContent = `a.zhihu_e_toQuestion {font-size: 14px !important;font-weight: normal !important;padding: 0 6px 2px !important;border-radius: 3px !important;display: inline-block !important;vertical-align: top !important;height: 23px !important;}`; + document.lastChild.appendChild(document.createElement('style')).textContent = `a.zhihu_e_toQuestion {font-size: 13px !important;font-weight: normal !important;padding: 1px 6px 0 !important;border-radius: 2px !important;display: inline-block !important;vertical-align: top !important;height: 21px !important;line-height: 21px !important;margin-top: 1.9px !important;}`; addSetInterval_('h2.ContentItem-title a:not(.zhihu_e_tips)'); } else { - document.lastChild.appendChild(document.createElement('style')).textContent = `a.zhihu_e_toQuestion {font-size: 14px !important;font-weight: normal !important;padding: 2px 6px !important;border-radius: 3px !important;display: inline-block !important;vertical-align: top !important;}`; + document.lastChild.appendChild(document.createElement('style')).textContent = `a.zhihu_e_toQuestion {font-size: 13px !important;font-weight: normal !important;padding: 1px 6px 0 !important;border-radius: 2px !important;display: inline-block !important;vertical-align: top !important;margin-top: 4px !important;}`; document.querySelectorAll('h2.ContentItem-title a:not(.zhihu_e_tips)').forEach(function(item){addTypeTips_(item);}) } From 624e22655812e9f3d88a0f50f4917e4df20e24f2 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 16 Aug 2021 21:16:08 +0800 Subject: [PATCH 0006/1967] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E5=8C=BA?= =?UTF-8?q?=E5=88=86=E9=97=AE=E9=A2=98=E6=96=87=E7=AB=A0]=E3=80=81[?= =?UTF-8?q?=E7=9B=B4=E8=BE=BE=E9=97=AE=E9=A2=98=E6=8C=89=E9=92=AE]=20?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= 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 32c0c8fed..3ec407085 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -928,7 +928,7 @@ function addToQuestion() { // 一开始加载的信息流 + 添加按钮样式 if (location.pathname === '/search') { - document.lastChild.appendChild(document.createElement('style')).textContent = `a.zhihu_e_toQuestion {font-size: 13px !important;font-weight: normal !important;padding: 1px 6px 0 !important;border-radius: 2px !important;display: inline-block !important;vertical-align: top !important;height: 21px !important;line-height: 21px !important;margin-top: 1.9px !important;}`; + document.lastChild.appendChild(document.createElement('style')).textContent = `a.zhihu_e_toQuestion {font-size: 13px !important;font-weight: normal !important;padding: 1px 6px 0 !important;border-radius: 2px !important;display: inline-block !important;vertical-align: top !important;height: 20.67px !important;line-height: 20.67px !important;margin-top: 2px !important;}`; addSetInterval_('h2.ContentItem-title a:not(.zhihu_e_tips)'); } else { document.lastChild.appendChild(document.createElement('style')).textContent = `a.zhihu_e_toQuestion {font-size: 13px !important;font-weight: normal !important;padding: 1px 6px 0 !important;border-radius: 2px !important;display: inline-block !important;vertical-align: top !important;margin-top: 4px !important;}`; From 51ea58e4f2262608745c85a6309beabedb1ceb57 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 17 Aug 2021 11:54:55 +0800 Subject: [PATCH 0007/1967] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 3ec407085..c6732c739 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎增强 -// @version 1.6.5 +// @version 1.6.6 // @author X.I.U // @description 移除登录弹窗、默认收起回答、一键收起回答、收起当前回答/评论(点击两侧空白处)、快捷回到顶部(右键两侧空白处)、屏蔽用户 (发布的内容)、屏蔽关键词(标题/评论)、屏蔽盐选内容、展开问题描述、置顶显示时间、完整问题时间、区分问题文章、直达问题按钮、默认高清原图、默认站外直链 // @match *://www.zhihu.com/* @@ -1329,9 +1329,9 @@ function questionInvitation(){ } function start(){ - collapsedAnswer(); // 一键收起回答 + if (location.hostname != 'zhuanlan.zhihu.com') collapsedAnswer(); // 一键收起回答 + if (location.hostname != 'zhuanlan.zhihu.com') questionInvitation(); //默认折叠邀请 closeFloatingComments(); // 快捷关闭悬浮评论(监听点击事件,点击网页两侧空白处) - questionInvitation(); // 默认折叠邀请 blockKeywords('comment'); // 屏蔽指定关键词(评论) if (location.pathname.indexOf('question') > -1) { // 回答页 // if (location.pathname.indexOf('waiting') == -1) { From 7c0ac79d8b159eb62b127386b2db55f3987f37d1 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 17 Aug 2021 11:55:55 +0800 Subject: [PATCH 0008/1967] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E5=AE=BD?= =?UTF-8?q?=E5=B1=8F=E6=98=BE=E7=A4=BA=20-=20=E9=A6=96=E9=A1=B5]=E3=80=81[?= =?UTF-8?q?=E5=AE=BD=E5=B1=8F=E6=98=BE=E7=A4=BA=20-=20=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E9=A1=B5]=E3=80=81[=E5=AE=BD=E5=B1=8F=E6=98=BE=E7=A4=BA=20-=20?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E9=A1=B5]=E3=80=81[=E5=AE=BD=E5=B1=8F?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=20-=20=E6=94=B6=E8=97=8F=E9=A1=B5]=20?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E8=8F=9C=E5=8D=95=E5=BC=80=E5=85=B3;=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E6=9A=97=E9=BB=91=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Beautification.user.js | 57 +++++++++++++++++++++++------------- 1 file changed, 37 insertions(+), 20 deletions(-) diff --git a/Zhihu-Beautification.user.js b/Zhihu-Beautification.user.js index d266fba72..af9958bb3 100644 --- a/Zhihu-Beautification.user.js +++ b/Zhihu-Beautification.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎美化 -// @version 1.3.0 +// @version 1.3.1 // @author X.I.U // @description 宽屏显示、暗黑模式(4种)、暗黑模式跟随浏览器、隐藏文章开头大图、调整图片最大高度、向下翻时自动隐藏顶栏、文章编辑页面与实际文章宽度一致、屏蔽登录提示 // @match *://www.zhihu.com/* @@ -24,6 +24,10 @@ 'use strict'; var menu_ALL = [ ['menu_widescreenDisplay', '宽屏显示', '宽屏显示', true], + ['menu_widescreenDisplayIndex', '宽屏显示 - 首页', '宽屏显示 - 首页', true], + ['menu_widescreenDisplayQuestion', '宽屏显示 - 问题页', '宽屏显示 - 问题页', true], + ['menu_widescreenDisplaySearch', '宽屏显示 - 搜索页', '宽屏显示 - 搜索页', true], + ['menu_widescreenDisplayCollection', '宽屏显示 - 收藏页', '宽屏显示 - 收藏页', true], ['menu_darkMode', '暗黑模式', '暗黑模式', true], ['menu_darkModeType', '暗黑模式切换(1~4)', '暗黑模式切换', 1], ['menu_darkModeAuto', '暗黑模式跟随浏览器', '暗黑模式跟随浏览器', false], @@ -52,6 +56,10 @@ GM_setValue('menu_darkModeType', menu_ALL[i][3]); } menu_ID[i] = GM_registerMenuCommand(`${menu_num(menu_ALL[i][3])} ${menu_ALL[i][1]}`, function(){menu_toggle(`${menu_ALL[i][3]}`,`${menu_ALL[i][0]}`)}); + } else if (menu_ALL[i][0] === 'menu_widescreenDisplayIndex' || menu_ALL[i][0] === 'menu_widescreenDisplayQuestion' || menu_ALL[i][0] === 'menu_widescreenDisplaySearch' || menu_ALL[i][0] === 'menu_widescreenDisplayCollection') { + if (menu_value('menu_widescreenDisplay')) { + menu_ID[i] = GM_registerMenuCommand(`${menu_ALL[i][3]?'✅':'❌'} ${menu_ALL[i][1]}`, function(){menu_switch(`${menu_ALL[i][3]}`,`${menu_ALL[i][0]}`,`${menu_ALL[i][2]}`)}); + } } else { menu_ID[i] = GM_registerMenuCommand(`${menu_ALL[i][3]?'✅':'❌'} ${menu_ALL[i][1]}`, function(){menu_switch(`${menu_ALL[i][3]}`,`${menu_ALL[i][0]}`,`${menu_ALL[i][2]}`)}); } @@ -122,7 +130,7 @@ // 添加样式 function addStyle() { - let style = `/* 屏蔽登录提示 */ + let style = `/* 屏蔽登录提示(问题页中间的元素) */ .Question-mainColumnLogin {display: none !important;} /* 屏蔽首页广告 */ .TopstoryItem--advertCard {display: none !important;} @@ -131,19 +139,23 @@ /* 屏蔽文章页推荐文章 */ .Recommendations-Main {display: none !important;} `, - style_1 = `/* 宽屏显示 */ -.GlobalSideBar, .Question-sideColumn, .ContentLayout-sideColumn, .SearchSideBar, .Card.QuestionHeaderTopicMeta, .ClubSideBar { - display: none !important; -} -.Topstory-mainColumn, .Question-mainColumn, .ContentLayout-mainColumn,.SearchMain, .QuestionWaiting-mainColumn, .Club-mainColumn, .Post-mainColumn { - width: 1000px !important; -} -.QuestionWaiting-mainColumn { - margin-right: 0 !important; -} -.ImageMessage-ImageView { - z-index: 999 !important; -}`, + style_widescreenDisplayIndex = `/* 宽屏显示 - 首页 */ +.Topstory-mainColumn {width: 1000px !important;} +.GlobalSideBar {display: none !important;} +`, + style_widescreenDisplayQuestion = `/* 宽屏显示 - 问题页 */ +.Question-mainColumn, .ListShortcut {width: 1000px !important;} +.Question-sideColumn {display: none !important;} +.QuestionWaiting-mainColumn {margin-right: 0 !important;} +`, + style_widescreenDisplaySearch = `/* 宽屏显示 - 搜索页 */ +.SearchMain, .ContentLayout-mainColumn, .QuestionWaiting-mainColumn, .Club-mainColumn, .Post-mainColumn {width: 1000px !important;} +.SearchSideBar, .ContentLayout-sideColumn, .Card.QuestionHeaderTopicMeta, .ClubSideBar {display: none !important;} +`, + style_widescreenDisplayCollection = `/* 宽屏显示 - 收藏页 */ +.CollectionsDetailPage-mainColumn {width: 1000px !important;} +.CollectionDetailPageSideBar {display: none !important;} +`, style_2 = `/* 隐藏在各列表中查看文章时开头显示的大图,不影响文章、专栏页面 */ .RichContent img.ArticleItem-image {display: none !important;} `, @@ -175,8 +187,8 @@ html[data-theme=dark] .Highlight em {color: #c33c39 !important;} /* 背景颜色 - 网页 */ html[data-theme=dark] body, html[data-theme=dark] .Select-option:focus {background: #22272E !important;} /* 背景颜色 - 问题 */ -html[data-theme=dark] .AppHeader, html[data-theme=dark] .QuestionHeader, html[data-theme=dark] .QuestionHeader-footer, html[data-theme=dark] .EmoticonsFooter-item--selected, html[data-theme=dark] .Card, html[data-theme=dark] .ContentItem-actions, html[data-theme=dark] .MoreAnswers .List-headerText, html[data-theme=dark] .CommentsV2-withPagination, html[data-theme=dark] .Topbar, html[data-theme=dark] .CommentsV2-footer, html[data-theme=dark] .CommentEditorV2-inputWrap--active, html[data-theme=dark] .InputLike, html[data-theme=dark] .Popover-content, html[data-theme=dark] .Notifications-footer, html[data-theme=dark] .Messages-footer, html[data-theme=dark] .Modal-inner, html[data-theme=dark] .Emoticons, html[data-theme=dark] .EmoticonsFooter, html[data-theme=dark] .SearchTabs, html[data-theme=dark] .Popover-arrow:after, html[data-theme=dark] .CommentEditorV2-inputWrap, html[data-theme=dark] .ProfileHeader-wrapper, html[data-theme=dark] .UserCover, html[data-theme=dark] .AnswerForm-footer, html[data-theme=dark] .Editable-toolbar, html[data-theme=dark] .AnswerForm-fullscreenContent .Editable-toolbar, html[data-theme=dark] .KfeCollection-PcCollegeCard-wrapper, html[data-theme=dark] .KfeCollection-PcCollegeCard-root, html[data-theme=dark] .HotItem, html[data-theme=dark] .HotList, html[data-theme=dark] .HotListNavEditPad, html[data-theme=dark] .QuestionWaiting-typesTopper, html[data-theme=dark] .QuestionWaiting-types, html[data-theme=dark] .PostItem, html[data-theme=dark] .ClubSideBar section, html[data-theme=dark] .SearchSubTabs, html[data-theme=dark] .Club-SearchPosts-Content, html[data-theme=dark] .Club-content, html[data-theme=dark] .ClubJoinOrCheckinButton, html[data-theme=dark] .ClubEdit, html[data-theme=dark] .CornerButton, html[data-theme=dark] .Notifications-Section-header, html[data-theme=dark] .NotificationList, .NotificationList-Item.NotificationList-Item:after, .NotificationList-DateSplit.NotificationList-DateSplit:after, html[data-theme=dark] .Chat, .ChatUserListItem:after, .ChatListGroup-SectionTitle--bottomBorder:after, html[data-theme=dark] .ActionMenu, .ChatSideBar-Search--active, html[data-theme=dark] .ChatSideBar-Search-ResultListWrap, html[data-theme=dark] .QuestionMainDivider-inner, html[data-theme=dark] .Topic-bar, html[data-theme=dark] .AnnotationTag, html[data-theme=dark] .HoverCard, html[data-theme=dark] .HoverCard-loading, html[data-theme=dark] .ExploreSpecialCard, html[data-theme=dark] .ExploreHomePage-ContentSection-moreButton a, html[data-theme=dark] .ExploreRoundtableCard, html[data-theme=dark] .ExploreCollectionCard, html[data-theme=dark] .ExploreColumnCard, html[data-theme=dark] .RichText .lazy[data-lazy-status], html[data-theme=dark] #TopstoryContent > div:first-child, html[data-theme=dark] .Topstory-newUserFollowCountPanel {background: #2D333B !important;} -html[data-theme=dark] .CommentListV2-header-divider, html[data-theme=dark] .CommentsV2-openComment-divider, html[data-theme=dark] .AnswerForm-fullscreenScroller, html[data-theme=dark] .HotListNav-item, html[data-theme=dark] .AutoInviteItem-wrapper--desktop, html[data-theme=dark] .ExploreSpecialCard-contentTag, html[data-theme=dark] .ExploreCollectionCard-contentTypeTag, html[data-theme=dark] .Reward-TipjarDialog-tagLine {background-color: #222933 !important;} +html[data-theme=dark] .AppHeader, html[data-theme=dark] .QuestionHeader, html[data-theme=dark] .QuestionHeader-footer, html[data-theme=dark] .EmoticonsFooter-item--selected, html[data-theme=dark] .Card, html[data-theme=dark] .ContentItem-actions, html[data-theme=dark] .MoreAnswers .List-headerText, html[data-theme=dark] .CommentsV2-withPagination, html[data-theme=dark] .Topbar, html[data-theme=dark] .CommentsV2-footer, html[data-theme=dark] .CommentEditorV2-inputWrap--active, html[data-theme=dark] .InputLike, html[data-theme=dark] .Popover-content, html[data-theme=dark] .Notifications-footer, html[data-theme=dark] .Messages-footer, html[data-theme=dark] .Modal-inner, html[data-theme=dark] .Emoticons, html[data-theme=dark] .EmoticonsFooter, html[data-theme=dark] .SearchTabs, html[data-theme=dark] .Popover-arrow:after, html[data-theme=dark] .CommentEditorV2-inputWrap, html[data-theme=dark] .ProfileHeader-wrapper, html[data-theme=dark] .UserCover, html[data-theme=dark] .AnswerForm-footer, html[data-theme=dark] .Editable-toolbar, html[data-theme=dark] .AnswerForm-fullscreenContent .Editable-toolbar, html[data-theme=dark] .KfeCollection-PcCollegeCard-wrapper, html[data-theme=dark] .KfeCollection-PcCollegeCard-root, html[data-theme=dark] .HotItem, html[data-theme=dark] .HotList, html[data-theme=dark] .HotListNavEditPad, html[data-theme=dark] .QuestionWaiting-typesTopper, html[data-theme=dark] .QuestionWaiting-types, html[data-theme=dark] .PostItem, html[data-theme=dark] .ClubSideBar section, html[data-theme=dark] .SearchSubTabs, html[data-theme=dark] .Club-SearchPosts-Content, html[data-theme=dark] .Club-content, html[data-theme=dark] .ClubJoinOrCheckinButton, html[data-theme=dark] .ClubEdit, html[data-theme=dark] .CornerButton, html[data-theme=dark] .Notifications-Section-header, html[data-theme=dark] .NotificationList, .NotificationList-Item.NotificationList-Item:after, .NotificationList-DateSplit.NotificationList-DateSplit:after, html[data-theme=dark] .Chat, .ChatUserListItem:after, .ChatListGroup-SectionTitle--bottomBorder:after, html[data-theme=dark] .ActionMenu, .ChatSideBar-Search--active, html[data-theme=dark] .ChatSideBar-Search-ResultListWrap, html[data-theme=dark] .QuestionMainDivider-inner, html[data-theme=dark] .Topic-bar, html[data-theme=dark] .AnnotationTag, html[data-theme=dark] .HoverCard, html[data-theme=dark] .HoverCard-loading, html[data-theme=dark] .ExploreSpecialCard, html[data-theme=dark] .ExploreHomePage-ContentSection-moreButton a, html[data-theme=dark] .ExploreRoundtableCard, html[data-theme=dark] .ExploreCollectionCard, html[data-theme=dark] .ExploreColumnCard, html[data-theme=dark] .RichText .lazy[data-lazy-status], html[data-theme=dark] #TopstoryContent > div:first-child, html[data-theme=dark] .Topstory-newUserFollowCountPanel, html[data-theme=dark] .AnswerForm-fullscreenContent .RichText {background: #2D333B !important;} +html[data-theme=dark] .CommentListV2-header-divider, html[data-theme=dark] .CommentsV2-openComment-divider, html[data-theme=dark] .AnswerForm-fullscreenScroller, html[data-theme=dark] .HotListNav-item, html[data-theme=dark] .AutoInviteItem-wrapper--desktop, html[data-theme=dark] .ExploreSpecialCard-contentTag, html[data-theme=dark] .ExploreCollectionCard-contentTypeTag, html[data-theme=dark] .Reward-TipjarDialog-tagLine, html[data-theme=dark] .AnswerForm-footer.useNewEditorSetting > div, html[data-theme=dark] .AnswerForm-fullscreenContent > div:first-child, html[data-theme=dark] .Editable-toolbar button:hover, html[data-theme=dark] .AuthorInfo.AnswerAdd-info + div {background-color: #222933 !important;} html[data-theme=dark] .CornerButton:hover {background: #3f4752 !important;} /* 右下角按钮 */ /* 背景颜色 - 引用 */ @@ -225,8 +237,8 @@ html[data-theme=dark] img {opacity: 0.8 !important;} html[data-theme=dark] .GifPlayer img, html[data-theme=dark] .ImageView-img {opacity: 1 !important;} /* 边框 */ -html[data-theme=dark] .Topbar, html[data-theme=dark] .CommentsV2-footer, html[data-theme=dark] .Topstory-mainColumnCard .Card:not(.Topstory-tabCard), html[data-theme=dark] .NestComment:not(:last-child):after, html[data-theme=dark] .NestComment--rootComment:after, html[data-theme=dark] .NestComment .NestComment--child:after, html[data-theme=dark] .NestComment .NestComment--child:after, html[data-theme=dark] .CommentsV2-replyNum, html[data-theme=dark] .CommentItemV2:not(:first-child):after, html[data-theme=dark] .Tabs, html[data-theme=dark] .Popover-arrow:after {border-bottom: 1px solid #282d35 !important;} -html[data-theme=dark] .CommentEditorV2-inputWrap--active, html[data-theme=dark] .CommentEditorV2-inputWrap, html[data-theme=dark] .PostItem {border: none !important;} +html[data-theme=dark] .Topbar, html[data-theme=dark] .CommentsV2-footer, html[data-theme=dark] .Topstory-mainColumnCard .Card:not(.Topstory-tabCard), html[data-theme=dark] .NestComment:not(:last-child):after, html[data-theme=dark] .NestComment--rootComment:after, html[data-theme=dark] .NestComment .NestComment--child:after, html[data-theme=dark] .NestComment .NestComment--child:after, html[data-theme=dark] .CommentsV2-replyNum, html[data-theme=dark] .CommentItemV2:not(:first-child):after, html[data-theme=dark] .Tabs, html[data-theme=dark] .Popover-arrow:after, html[data-theme=dark] .SelfCollectionItem-innerContainer, html[data-theme=dark] .CollectionDetailPageItem-innerContainer {border-bottom: 1px solid #282d35 !important;} +html[data-theme=dark] .CommentEditorV2-inputWrap--active, html[data-theme=dark] .CommentEditorV2-inputWrap, html[data-theme=dark] .PostItem, html[data-theme=dark] .AnswerForm .Editable-toolbar, html[data-theme=dark] .Editable-toolbar span {border: none !important;} html[data-theme=dark] .InputLike {border: 1px solid #424b56 !important;} html[data-theme=dark] .Popover .InputLike {border: 1px solid #2d333b !important;} html[data-theme=dark] .HotLanding-contentItem:not(:last-child) {border-bottom: 1px solid #424b56 !important;} @@ -355,7 +367,12 @@ html {filter: brightness(75%) sepia(30%) !important; background-image: url();} } // 宽屏显示 - if (menu_value('menu_widescreenDisplay')) style += style_1; + if (menu_value('menu_widescreenDisplay')){ + if (menu_value('menu_widescreenDisplayIndex')) style += style_widescreenDisplayIndex; + if (menu_value('menu_widescreenDisplayQuestion') && location.pathname.indexOf('/question/') > -1) style += style_widescreenDisplayQuestion; + if (menu_value('menu_widescreenDisplaySearch') && (location.pathname === '/search' || location.pathname.indexOf('/club/') > -1 || location.pathname.indexOf('/topic/') > -1)) style += style_widescreenDisplaySearch; + if (menu_value('menu_widescreenDisplayCollection') && location.pathname.indexOf('/collection/') > -1) style += style_widescreenDisplayCollection; + } // 调整图片最大高度 if (menu_value('menu_picHeight')) style += style_5; // 隐藏文章开头大图 From 330e0ea1f726fd5f3b6e5519282e0fcf36f8802a Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 17 Aug 2021 12:37:58 +0800 Subject: [PATCH 0009/1967] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E8=B0=B7?= =?UTF-8?q?=E6=AD=8C=E6=90=9C=E7=B4=A2]=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 | 40 ++++++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/Autopage.user.js b/Autopage.user.js index b645f4277..f273c060d 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 自动无缝翻页 -// @version 1.5.2 +// @version 1.5.3 // @author X.I.U -// @description 自动无缝翻页,目前支持:[所有使用「Discuz!、Flarum、DUX(WordPress)」的网站]、百度、豆瓣、微博、千图网、3DM、游侠网、游民星空、Steam 创意工坊、423Down、不死鸟、小众软件、微当下载、异次元软件、老殁殁漂遥、异星软件空间、古风漫画网、砂之船动漫家、RARBG、PubMed、AfreecaTV、GreasyFork、AlphaCoders、Crackhub213、FitGirl Repacks... +// @description 自动无缝翻页,目前支持:[所有使用「Discuz!、Flarum、DUX(WordPress)」的网站]、百度、谷歌、豆瓣、微博、千图网、3DM、游侠网、游民星空、Steam 创意工坊、423Down、不死鸟、小众软件、微当下载、异次元软件、老殁殁漂遥、异星软件空间、古风漫画网、砂之船动漫家、RARBG、PubMed、AfreecaTV、GreasyFork、AlphaCoders、Crackhub213、FitGirl Repacks... // @match *://*/* // @connect www.gamersky.com // @icon https://i.loli.net/2021/03/07/rdijeYm83pznxWq.png @@ -23,7 +23,7 @@ 'use strict'; var webType, curSite = {SiteTypeID: 0}; // 目前支持的网站 - const websiteList = ['www.baidu.com', 'movie.douban.com', 'weibo.com', 'www.58pic.com', + const websiteList = ['www.baidu.com', 'www.google.com', 'movie.douban.com', 'weibo.com', 'www.58pic.com', 'www.3dmgame.com', 'www.ali213.net', 'gl.ali213.net', 'www.gamersky.com', 'steamcommunity.com', 'www.423down.com', 'iao.su', 'www.appinn.com', 'www.weidown.com', 'www.iplaysoft.com', 'www.mpyit.com', 'www.yxssp.com', 'www.gufengmh8.com', 'www.szcdmj.com', @@ -177,6 +177,17 @@ scrollDelta: 1200 } }, + google: { + SiteTypeID: 0, + pager: { + type: 1, + nextLink: '//a[@id="pnnext"][@href]', + pageElement: 'css;#res > *', + HT_insert: ['css;#res', 3], + replaceE: '//div[@id="navcnt"] | //div[@id="rcnt"]//div[@role="navigation"]', + scrollDelta: 1500 + } + }, douban_subject_comments: { SiteTypeID: 0, pager: { @@ -576,6 +587,7 @@ // 用于脚本判断(针对部分特殊的网站) const SiteType = { + GOOGLE: DBSite.google.SiteTypeID, GAMERSKY_GL: DBSite.gamersky_gl.SiteTypeID, STEAMCOMMUNITY: DBSite.steamcommunity.SiteTypeID }; @@ -587,6 +599,9 @@ case 'www.baidu.com': // < 百度搜索 > if (location.pathname === '/s') curSite = DBSite.baidu; break; + case 'www.google.com': // < 谷歌搜索 > + if (location.pathname === '/search') curSite = DBSite.google; + break; case 'movie.douban.com': // < 豆瓣评论 > if (location.pathname.indexOf('/subject') > -1 && location.pathname.indexOf('/comments') > -1) { // 短评列表 curSite = DBSite.douban_subject_comments; @@ -1145,7 +1160,7 @@ if (curSite.pager) { let curPageEle = getElementByXpath(curSite.pager.nextLink); var url = this.getFullHref(curPageEle); - //console.log(`${url} ${curPageEle} ${curSite.pageUrl}`); + console.log(`${url} ${curPageEle} ${curSite.pageUrl}`); if (url === '') return; if (curSite.pageUrl === url) return;// 避免重复加载相同的页面 curSite.pageUrl = url; @@ -1161,7 +1176,7 @@ var newBody = ShowPager.createDocumentByString(response.responseText); let pageElems = getAllElements(curSite.pager.pageElement, newBody, newBody), toElement = getAllElements(curSite.pager.HT_insert[0])[0]; - //console.log(curSite.pager.pageElement, pageElems) + console.log(curSite.pager.pageElement, pageElems) if (pageElems.length >= 0) { // 如果有插入前函数就执行函数 @@ -1179,15 +1194,20 @@ if (curSite.SiteTypeID === SiteType.STEAMCOMMUNITY) { pageElems.forEach(function (one) { if (one.tagName === 'SCRIPT') { // 对于