MCPcopy Create free account
hub / github.com/XIU2/UserScript / blockYanXuan_question_answer

Function blockYanXuan_question_answer

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

Source from the content-addressed store, hash-verified

1230 };
1231
1232 const blockYanXuan_question_answer = (mutationsList, observer) => {
1233 for (const mutation of mutationsList) {
1234 for (const target of mutation.addedNodes) {
1235 if (target.nodeType != 1) return
1236 target.querySelectorAll('.List-item, .Card.AnswerCard').forEach(function(item){
1237 if (item.querySelector('.KfeCollection-AnswerTopCard-Container, .KfeCollection-PurchaseBtn')) {
1238 item.hidden = true;
1239 }
1240 })
1241 }
1242 }
1243 };
1244
1245 if (location.pathname.indexOf('/answer/') > -1) { // 回答页(就是只有三个回答的页面)
1246 const observer = new MutationObserver(blockYanXuan_question_answer);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected