| 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 | |