現在のスパムの大洪水を修正
5007 ワード
Grease Monkeyなどを使用する場合は、このユーザースクリプトを使用して、フィードの現在のスパム投稿をフィルタアウトできます.
あなたがフィルタをキックするためのハードリフレッシュを行う必要があります.
突然変異オブザーバコードのためにMDNに感謝します.
// ==UserScript==
// @name dev.to spam filter
// @version 1
// @include http*
// @match *://dev.to/*
// @grant none
// @run-at document-end
// ==/UserScript==
const dev_posts = document.body;
const config = { attributes: false, childList: true, subtree: true };
const callback = function(mutationsList, observer)
{
for(const mutation of mutationsList)
{
if (mutation.type === 'childList')
{
let posts = document.querySelectorAll('article');
posts.forEach(post =>
{
const title = post.querySelector('.crayons-story__title a');
if(title.innerHTML.replace(/\n/g, '').match(/customer.*care.*number/i))
{
post.parentElement.removeChild(post);
console.log('removed post')
}
});
}
}
};
// Create an observer instance linked to the callback function
const observer = new MutationObserver(callback);
// Start observing the target node for configured mutations
observer.observe(dev_posts, config);
賢い人々が本当のスパムフィルタを見ている間、明らかにこれは一時的な仕事です、しかし、私の飼料はブラウズできませんでした:Dあなたがフィルタをキックするためのハードリフレッシュを行う必要があります.
突然変異オブザーバコードのためにMDNに感謝します.
Reference
この問題について(現在のスパムの大洪水を修正), 我々は、より多くの情報をここで見つけました https://dev.to/mellen/quick-fix-for-current-spam-deluge-3a9oテキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol