MCPcopy Index your code
hub / github.com/XIU2/UserScript / blockKeywords_1

Function blockKeywords_1

Zhihu-Enhanced.user.js:1049–1064  ·  view source on GitHub ↗
(item1, css)

Source from the content-addressed store, hash-verified

1047 }
1048
1049 function blockKeywords_1(item1, css) {
1050 let item = item1.querySelector(css); // 标题所在元素
1051 //console.log(item)
1052 if (item) {
1053 for (const keyword of menu_value('menu_customBlockKeywords')) { // 遍历关键词黑名单
1054 let text = item.content || item.textContent;
1055 //console.log(text,keyword)
1056 if (keyword != '' && text.toLowerCase().indexOf(keyword.toLowerCase()) > -1) { // 找到就删除该信息流
1057 console.log('已屏蔽:' + text);
1058 item1.hidden = true;
1059 item1.style.display = 'none';
1060 break;
1061 }
1062 }
1063 }
1064 }
1065}
1066
1067

Callers 2

blockKeywords_nowFunction · 0.85
callbackFunction · 0.85

Calls 1

menu_valueFunction · 0.70

Tested by

no test coverage detected