Greasy Fork

Greasy Fork is available in English.

Ars Technica Author Remover

Remove articles by certain bad, click-bait authors from Ars Technica

当前为 2024-11-21 提交的版本,查看 最新版本

// ==UserScript==
// @name        Ars Technica Author Remover
// @namespace    author remover
// @version      1.2
// @description  Remove articles by certain bad, click-bait authors from Ars Technica
// @author       -
// @match       https://arstechnica.com/*
// @match       https://www.arstechnica.com/*
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    // Function to remove articles by Beth Mole
    function removeBethMoleArticles() {
        // Select all article elements
        const articles = document.querySelectorAll('article');

        articles.forEach(article => {
            // Find the author span within the article
            const authorSpan = article.querySelector('div > span');

            // Check if the author is "Beth Mole"
            if (authorSpan && authorSpan.textContent.trim() === 'Beth Mole') {
                // Remove the article from the DOM
                article.remove();
            }
        });
    }

    // Run the function to remove articles
    removeBethMoleArticles();

    // Optional: Observe for dynamically loaded content and remove matching articles
    const observer = new MutationObserver(removeBethMoleArticles);
    observer.observe(document.body, { childList: true, subtree: true });

})();