|
3 | 3 | // @name:zh-CN 知乎增强 |
4 | 4 | // @name:zh-TW 知乎增強 |
5 | 5 | // @name:en Zhihu enhancement |
6 | | -// @version 2.3.1 |
| 6 | +// @version 2.3.2 |
7 | 7 | // @author X.I.U |
8 | | -// @description 移除登录弹窗、屏蔽首页视频、默认收起回答、快捷收起回答/评论(左键两侧)、快捷回到顶部(右键两侧)、屏蔽用户、屏蔽关键词、移除高亮链接、屏蔽盐选内容/热榜杂项、净化搜索热门、净化标题消息、展开问题描述、显示问题作者、置顶显示时间、完整问题时间、区分问题文章、直达问题按钮、默认高清原图、默认站外直链 |
9 | | -// @description:zh-TW 移除登錄彈窗、屏蔽首頁視頻、默認收起回答、快捷收起回答/評論、快捷回到頂部、屏蔽用戶、屏蔽關鍵詞、移除高亮鏈接、屏蔽鹽選內容、淨化搜索熱門、淨化標題消息、置頂顯示時間、完整問題時間、區分問題文章、默認高清原圖、默認站外直鏈... |
| 8 | +// @description 屏蔽首页视频、默认收起回答、快捷收起回答/评论(左键两侧)、快捷回到顶部(右键两侧)、屏蔽用户、屏蔽关键词、移除高亮链接、屏蔽盐选内容/热榜杂项、净化搜索热门、净化标题消息、展开问题描述、显示问题作者、置顶显示时间、完整问题时间、区分问题文章、直达问题按钮、默认高清原图(无水印)、默认站外直链 |
| 9 | +// @description:zh-TW 屏蔽首頁視頻、默認收起回答、快捷收起回答/評論、快捷回到頂部、屏蔽用戶、屏蔽關鍵詞、移除高亮鏈接、屏蔽鹽選內容、淨化搜索熱門、淨化標題消息、置頂顯示時間、完整問題時間、區分問題文章、默認高清原圖、默認站外直鏈... |
10 | 10 | // @description:en A more personalized Zhihu experience~ |
11 | 11 | // @match *://www.zhihu.com/* |
12 | 12 | // @match *://zhuanlan.zhihu.com/* |
@@ -1371,15 +1371,15 @@ function getUTC8(t) { |
1371 | 1371 | } |
1372 | 1372 |
|
1373 | 1373 |
|
1374 | | -// 默认站外直链,修改自:https://greasyfork.org/scripts/402808(从 JQuery 改为原生 JavaScript,且精简、优化了代码) |
1375 | | -function directLink () { |
1376 | | - 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));}); |
| 1374 | +// 默认高清原图(无水印) |
| 1375 | +function originalPic(){ |
| 1376 | + 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';}); |
1377 | 1377 | } |
1378 | 1378 |
|
1379 | 1379 |
|
1380 | | -// 默认高清原图,修改自:https://greasyfork.org/scripts/402808(从 JQuery 改为原生 JavaScript,且精简、优化了代码) |
1381 | | -function originalPic(){ |
1382 | | - document.querySelectorAll('img[data-original]:not(.comment_sticker):not(.Avatar)').forEach(function(one){if (one.src != one.dataset.original) {one.src = one.dataset.original}}); |
| 1380 | +// 默认站外直链,修改自:https://greasyfork.org/scripts/402808(从 JQuery 改为原生 JavaScript,且精简、优化了代码) |
| 1381 | +function directLink () { |
| 1382 | + 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));}); |
1383 | 1383 | } |
1384 | 1384 |
|
1385 | 1385 |
|
@@ -1494,8 +1494,9 @@ function blockHotOther() { |
1494 | 1494 |
|
1495 | 1495 | function start(){ |
1496 | 1496 | removeHighlightLink(); // 移除高亮链接 |
1497 | | - setInterval(originalPic,100); // 默认高清原图 |
1498 | | - setInterval(directLink, 100); // 默认站外直链 |
| 1497 | + originalPic();directLink(); // 先立即执行一次 |
| 1498 | + setInterval(originalPic,500); // 默认高清原图(无水印) |
| 1499 | + setInterval(directLink, 500); // 默认站外直链 |
1499 | 1500 | if (location.hostname != 'zhuanlan.zhihu.com') { |
1500 | 1501 | if (location.pathname.indexOf('/column/') === -1) cleanSearch(); //净化搜索热门 |
1501 | 1502 | collapsedAnswer(); // 一键收起回答 |
|
0 commit comments