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

Function callback

DuckDuckGo-Enhanced.user.js:84–96  ·  view source on GitHub ↗
(mutationsList, observer)

Source from the content-addressed store, hash-verified

82 // 屏蔽指定域名 链接不携来源
83 function mutationObserver() {
84 const callback = (mutationsList, observer) => {
85 for (const mutation of mutationsList) {
86 for (const target of mutation.addedNodes) {
87 if (target.nodeType != 1) break
88 // 屏蔽指定域名
89 if (target.tagName == 'LI' && target.dataset.layout == 'organic') {
90 Process(target)
91 } else if (target.tagName == 'OL' && target.className == 'react-results--main') {
92 target.childNodes.forEach(li=>{Process(li);})
93 }
94 }
95 }
96 };
97 const observer = new MutationObserver(callback);
98 observer.observe(document, { childList: true, subtree: true });
99

Callers

nothing calls this directly

Calls 1

ProcessFunction · 0.85

Tested by

no test coverage detected