Greasy Fork is available in English.

討論 » 建立請求

csdn标题消息能完全去掉吗

§
發表於:2021-12-19

用每100ms检查标题去掉的办法,会不停的闪,不能完全去除

§
發表於:2021-12-21

Use:

.class-of-this-element{display: none}; // elem.style.display = 'none'

or

let observer = new MutationObserver(mutationRecords => {
mutationRecords.forEach( (record)=>{
record.addedNodes( (node)=> {
if (node.classList.includes('your-element-class')) node.parentNode.removeChild(node);
} )
} )
});

observer.observe(document, {
childList: true,
subtree: true
});

NEVER use setInterval like this
§
發表於:2021-12-21

Use:

Thank you for your replay.

What I mean is that to forbid auto-add '(2 new messages)' in the title from some site, instead of delete some element of a website.

§
發表於:2021-12-22

If you want to forbid the auto adding, I think you need to redefine appendChild method of the parent node (it will work only if this element adding to parent by this method).

element.parentNode.appendChild = function(){}

發表回覆

登入以回復