Skip to content

Commit c99be0a

Browse files
committed
新增 [屏蔽关键词]、[屏蔽类别] 对 首页关注页 的支持
1 parent 22a2e66 commit c99be0a

1 file changed

Lines changed: 18 additions & 9 deletions

File tree

Zhihu-Enhanced.user.js

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// @name:zh-CN 知乎增强
44
// @name:zh-TW 知乎增強
55
// @name:en Zhihu enhancement
6-
// @version 2.2.15
6+
// @version 2.3.0
77
// @author X.I.U
88
// @description 移除登录弹窗、屏蔽首页视频、默认收起回答、快捷收起回答/评论(左键两侧)、快捷回到顶部(右键两侧)、屏蔽用户、屏蔽关键词、移除高亮链接、屏蔽盐选内容/热榜杂项、净化搜索热门、净化标题消息、展开问题描述、显示问题作者、置顶显示时间、完整问题时间、区分问题文章、直达问题按钮、默认高清原图、默认站外直链
99
// @description:zh-TW 移除登錄彈窗、屏蔽首頁視頻、默認收起回答、快捷收起回答/評論、快捷回到頂部、屏蔽用戶、屏蔽關鍵詞、移除高亮鏈接、屏蔽鹽選內容、淨化搜索熱門、淨化標題消息、置頂顯示時間、完整問題時間、區分問題文章、默認高清原圖、默認站外直鏈...
@@ -754,6 +754,9 @@ function blockKeywords(type) {
754754
case 'index':
755755
blockKeywords_('.Card.TopstoryItem.TopstoryItem-isRecommend', 'Card TopstoryItem TopstoryItem-isRecommend');
756756
break;
757+
case 'follow':
758+
blockKeywords_('.Card.TopstoryItem.TopstoryItem-isFollow', 'Card TopstoryItem TopstoryItem-isFollow');
759+
break;
757760
case 'topic':
758761
blockKeywords_('.List-item.TopicFeedItem', 'List-item TopicFeedItem');
759762
break;
@@ -1460,18 +1463,21 @@ function blockHotOther() {
14601463
blockUsers('question'); // 屏蔽指定用户
14611464
blockYanXuan(); // 屏蔽盐选内容
14621465
}, 300);
1463-
} else if (location.pathname == '/') {
1466+
} else if (location.pathname == '/') { // 推荐
14641467
setTimeout(()=>{
14651468
blockUsers('index'); // 屏蔽指定用户
14661469
blockKeywords('index'); // 屏蔽指定关键词
14671470
blockType(); // 屏蔽指定类别(视频/文章等)
14681471
}, 500);
1469-
} else if (location.pathname == '/hot') {
1472+
} else if (location.pathname == '/hot') { // 热榜
1473+
setTimeout(()=>{
1474+
blockKeywords('index'); // 屏蔽指定关键词
1475+
blockHotOther(); // 移除热播杂项
1476+
}, 500);
1477+
} else if (location.pathname == '/follow') { // 关注
14701478
setTimeout(()=>{
1471-
//屏蔽指定关键词
1472-
blockKeywords('index');
1473-
// 移除热播杂项
1474-
blockHotOther();
1479+
blockKeywords('follow'); // 屏蔽指定关键词
1480+
blockType(); // 屏蔽指定类别(视频/文章等)
14751481
}, 500);
14761482
}
14771483
})
@@ -1577,13 +1583,16 @@ function blockHotOther() {
15771583
setInterval(function(){topTime_('.TopstoryItem', 'ContentItem-meta')}, 300); // 置顶显示时间
15781584
addTypeTips(); // 区分问题文章
15791585
addToQuestion(); // 直达问题按钮
1580-
if (location.pathname == '/') {
1586+
if (location.pathname == '/') { // 推荐
15811587
blockUsers('index'); // 屏蔽指定用户
15821588
blockKeywords('index'); // 屏蔽指定关键词
15831589
blockType(); // 屏蔽指定类别(视频/文章等)
1584-
} else if (location.pathname == '/hot') {
1590+
} else if (location.pathname == '/hot') { // 热榜
15851591
blockKeywords('index'); // 屏蔽指定关键词
15861592
blockHotOther(); // 屏蔽热榜杂项
1593+
} else if (location.pathname == '/follow') { // 关注
1594+
blockKeywords('follow'); // 屏蔽指定关键词
1595+
blockType(); // 屏蔽指定类别(视频/文章等)
15871596
} else {
15881597
blockUsers();
15891598
}

0 commit comments

Comments
 (0)