From e3de3a53028345c97261d775683840ef79b7706d Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Fri, 17 Feb 2023 18:00:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E5=B1=8F=E8=94=BD?= =?UTF-8?q?=E8=A7=86=E9=A2=91=E5=90=8E=E5=9C=A8=E9=A6=96=E9=A1=B5=E6=8C=89?= =?UTF-8?q?=E7=A9=BA=E6=A0=BC=E9=94=AE=E6=BB=9A=E5=8A=A8=E4=BC=9A=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E8=A7=86=E9=A2=91=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 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 7ae5a7b..d9318fe 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -3,7 +3,7 @@ // @name:zh-CN 知乎增强 // @name:zh-TW 知乎增強 // @name:en Zhihu enhancement -// @version 2.2.5 +// @version 2.2.6 // @author X.I.U // @description 移除登录弹窗、屏蔽首页视频、默认收起回答、快捷收起回答/评论(左键两侧)、快捷回到顶部(右键两侧)、屏蔽用户、屏蔽关键词、移除高亮链接、屏蔽盐选内容/热榜直播、净化搜索热门、净化标题消息、展开问题描述、显示问题作者、置顶显示时间、完整问题时间、区分问题文章、直达问题按钮、默认高清原图、默认站外直链 // @description:zh-TW 移除登錄彈窗、屏蔽首頁視頻、默認收起回答、快捷收起回答/評論、快捷回到頂部、屏蔽用戶、屏蔽關鍵詞、移除高亮鏈接、屏蔽鹽選內容、淨化搜索熱門、淨化標題消息、置頂顯示時間、完整問題時間、區分問題文章、默認高清原圖、默認站外直鏈... @@ -888,12 +888,12 @@ function blockType(type) { addSetInterval_(name); } else if (type === 'question') { // 问题页 if (!menu_value('menu_blockTypeVideo')) return - document.lastChild.appendChild(document.createElement('style')).textContent = `.VideoAnswerPlayer, .VideoAnswerPlayer-video, .VideoAnswerPlayer-iframe {display: none !important;}`; + document.lastChild.appendChild(document.createElement('style')).textContent = `.VideoAnswerPlayer, .VideoAnswerPlayer video, .VideoAnswerPlayer-video, .VideoAnswerPlayer-iframe {display: none !important;}`; name = '.VideoAnswerPlayer' document.querySelectorAll(name).forEach(function(item){blockType_(item);}) } else { // 首页 if (!menu_value('menu_blockTypeVideo') && !menu_value('menu_blockTypeArticle')) return - if (menu_value('menu_blockTypeVideo')) document.lastChild.appendChild(document.createElement('style')).textContent = `.Card .ZVideoItem-video, nav.TopstoryTabs > a[aria-controls="Topstory-zvideo"] {display: none !important;}`; + if (menu_value('menu_blockTypeVideo')) document.lastChild.appendChild(document.createElement('style')).textContent = `.Card .ZVideoItem-video, .VideoAnswerPlayer video, nav.TopstoryTabs > a[aria-controls="Topstory-zvideo"] {display: none !important;}`; name = 'h2.ContentItem-title a:not(.zhihu_e_toQuestion)' document.querySelectorAll(name).forEach(function(item){blockType_(item);}) } @@ -921,7 +921,7 @@ function blockType(type) { if (location.pathname === '/search') { // 搜索页 if (location.search.indexOf('type=content') === -1) return // 仅限搜索页的 [综合] if (titleA.href.indexOf('/zvideo/') > -1 || titleA.href.indexOf('video.zhihu.com') > -1) { // 如果是视频 - if (menu_value('menu_blockTypeVideo')) findParentElement(titleA, 'Card').hidden = true; + if (menu_value('menu_blockTypeVideo')) findParentElement(titleA, 'Card').remove(); } else if (titleA.href.indexOf('zhuanlan.zhihu.com') > -1) { // 如果是文章 if (menu_value('menu_blockTypeArticle')) findParentElement(titleA, 'Card SearchResult-Card').hidden = true; } else if (titleA.href.indexOf('/topic/') > -1) { // 如果是话题 @@ -933,13 +933,13 @@ function blockType(type) { if (menu_value('menu_blockTypeVideo')) findParentElement(titleA, 'List-item').hidden = true; } else { // 首页 if (titleA.href.indexOf('/zvideo/') > -1 || titleA.href.indexOf('video.zhihu.com') > -1) { // 如果是视频 - if (menu_value('menu_blockTypeVideo')) findParentElement(titleA, 'Card TopstoryItem TopstoryItem-isRecommend').hidden = true; + if (menu_value('menu_blockTypeVideo')) findParentElement(titleA, 'Card TopstoryItem TopstoryItem-isRecommend').remove(); } else if (titleA.href.indexOf('/answer/') > -1) { // 如果是问题(视频回答) if (findParentElement(titleA, 'ContentItem AnswerItem').querySelector('.VideoAnswerPlayer')) { - if (menu_value('menu_blockTypeVideo')) findParentElement(titleA, 'Card TopstoryItem TopstoryItem-isRecommend').hidden = true; + if (menu_value('menu_blockTypeVideo')) findParentElement(titleA, 'Card TopstoryItem TopstoryItem-isRecommend').remove(); } } else if (titleA.href.indexOf('/education/video-course/') > -1) { // 如果是視頻課程 - if (menu_value('menu_blockTypeVideo')) findParentElement(titleA, 'Card TopstoryItem TopstoryItem-isRecommend').hidden = true; + if (menu_value('menu_blockTypeVideo')) findParentElement(titleA, 'Card TopstoryItem TopstoryItem-isRecommend').remove(); } else if (titleA.href.indexOf('zhuanlan.zhihu.com') > -1) { // 如果是文章 if (menu_value('menu_blockTypeArticle')) findParentElement(titleA, 'Card TopstoryItem TopstoryItem-isRecommend').hidden = true; }