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

Function blockUsers_question_

Zhihu-Enhanced.user.js:608–625  ·  view source on GitHub ↗
(mutationsList, observer)

Source from the content-addressed store, hash-verified

606
607 function blockUsers_question() {
608 const blockUsers_question_ = (mutationsList, observer) => {
609 for (const mutation of mutationsList) {
610 for (const target of mutation.addedNodes) {
611 if (target.nodeType != 1) return
612 if (target.className === 'List-item' || target.className === 'Card AnswerCard') {
613 let item1 = target.querySelector('.ContentItem.AnswerItem');
614 if (item1) {
615 menu_value('menu_customBlockUsers').forEach(function(item2){ // 遍历用户黑名单
616 if (item1.dataset.zop.indexOf('authorName":"' + item2 + '",') > -1) { // 找到就删除该回答
617 console.log('已屏蔽:' + item1.dataset.zop)
618 target.hidden = true;
619 }
620 })
621 }
622 }
623 }
624 }
625 };
626
627 const blockUsers_question_answer_ = (mutationsList, observer) => {
628 for (const mutation of mutationsList) {

Callers

nothing calls this directly

Calls 1

menu_valueFunction · 0.70

Tested by

no test coverage detected