From f811ad3cb2bcc2f5d3c7664d0cf3d51f0d6a56c4 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 26 Jun 2024 11:03:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20[=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E9=AB=98=E6=B8=85=E5=8E=9F=E5=9B=BE]=20=E4=B8=BA=20[=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E9=AB=98=E6=B8=85=E5=8E=9F=E5=9B=BE=EF=BC=88=E6=97=A0?= =?UTF-8?q?=E6=B0=B4=E5=8D=B0=EF=BC=89]=20(=E6=84=9F=E8=B0=A2=20@pgdhao123?= =?UTF-8?q?=20=E6=8F=90=E4=BE=9B=E6=96=B9=E6=B3=95)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 7217794..1995a65 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -3,10 +3,10 @@ // @name:zh-CN 知乎增强 // @name:zh-TW 知乎增強 // @name:en Zhihu enhancement -// @version 2.3.1 +// @version 2.3.2 // @author X.I.U -// @description 移除登录弹窗、屏蔽首页视频、默认收起回答、快捷收起回答/评论(左键两侧)、快捷回到顶部(右键两侧)、屏蔽用户、屏蔽关键词、移除高亮链接、屏蔽盐选内容/热榜杂项、净化搜索热门、净化标题消息、展开问题描述、显示问题作者、置顶显示时间、完整问题时间、区分问题文章、直达问题按钮、默认高清原图、默认站外直链 -// @description:zh-TW 移除登錄彈窗、屏蔽首頁視頻、默認收起回答、快捷收起回答/評論、快捷回到頂部、屏蔽用戶、屏蔽關鍵詞、移除高亮鏈接、屏蔽鹽選內容、淨化搜索熱門、淨化標題消息、置頂顯示時間、完整問題時間、區分問題文章、默認高清原圖、默認站外直鏈... +// @description 屏蔽首页视频、默认收起回答、快捷收起回答/评论(左键两侧)、快捷回到顶部(右键两侧)、屏蔽用户、屏蔽关键词、移除高亮链接、屏蔽盐选内容/热榜杂项、净化搜索热门、净化标题消息、展开问题描述、显示问题作者、置顶显示时间、完整问题时间、区分问题文章、直达问题按钮、默认高清原图(无水印)、默认站外直链 +// @description:zh-TW 屏蔽首頁視頻、默認收起回答、快捷收起回答/評論、快捷回到頂部、屏蔽用戶、屏蔽關鍵詞、移除高亮鏈接、屏蔽鹽選內容、淨化搜索熱門、淨化標題消息、置頂顯示時間、完整問題時間、區分問題文章、默認高清原圖、默認站外直鏈... // @description:en A more personalized Zhihu experience~ // @match *://www.zhihu.com/* // @match *://zhuanlan.zhihu.com/* @@ -1371,15 +1371,15 @@ function getUTC8(t) { } -// 默认站外直链,修改自:https://greasyfork.org/scripts/402808(从 JQuery 改为原生 JavaScript,且精简、优化了代码) -function directLink () { - document.querySelectorAll('a.external[href*="link.zhihu.com/?target="], a.LinkCard[href*="link.zhihu.com/?target="]:not(.MCNLinkCard):not(.ZVideoLinkCard):not(.ADLinkCardContainer)').forEach(function (_this) {_this.href = decodeURIComponent(_this.href.substring(_this.href.indexOf('link.zhihu.com/?target=') + 23));}); +// 默认高清原图(无水印) +function originalPic(){ + document.querySelectorAll('img[data-original][data-original-token][data-lazy-status]:not([data-original-xiu]):not(.comment_sticker):not(.Avatar)').forEach(function(one){one.src = 'https://' + one.dataset.original.split('/')[2] + '/' + one.dataset.originalToken + '.webp'; one.dataset.originalXiu = 'true';}); } -// 默认高清原图,修改自:https://greasyfork.org/scripts/402808(从 JQuery 改为原生 JavaScript,且精简、优化了代码) -function originalPic(){ - document.querySelectorAll('img[data-original]:not(.comment_sticker):not(.Avatar)').forEach(function(one){if (one.src != one.dataset.original) {one.src = one.dataset.original}}); +// 默认站外直链,修改自:https://greasyfork.org/scripts/402808(从 JQuery 改为原生 JavaScript,且精简、优化了代码) +function directLink () { + document.querySelectorAll('a.external[href*="link.zhihu.com/?target="], a.LinkCard[href*="link.zhihu.com/?target="]:not(.MCNLinkCard):not(.ZVideoLinkCard):not(.ADLinkCardContainer)').forEach(function (_this) {_this.href = decodeURIComponent(_this.href.substring(_this.href.indexOf('link.zhihu.com/?target=') + 23));}); } @@ -1494,8 +1494,9 @@ function blockHotOther() { function start(){ removeHighlightLink(); // 移除高亮链接 - setInterval(originalPic,100); // 默认高清原图 - setInterval(directLink, 100); // 默认站外直链 + originalPic();directLink(); // 先立即执行一次 + setInterval(originalPic,500); // 默认高清原图(无水印) + setInterval(directLink, 500); // 默认站外直链 if (location.hostname != 'zhuanlan.zhihu.com') { if (location.pathname.indexOf('/column/') === -1) cleanSearch(); //净化搜索热门 collapsedAnswer(); // 一键收起回答