隱藏特定學校文章 - Dcard 廢版

在 Dcard 的廢版隱藏來自特定學校的文章

目前為 2024-11-11 提交的版本,檢視 最新版本

// ==UserScript==
// @name         隱藏特定學校文章 - Dcard 廢版
// @name:en      Hide Specific School Posts - Dcard (Deprecated)
// @description  在 Dcard 的廢版隱藏來自特定學校的文章
// @description:en This script allows you to hide anonymous posts from schools you don't like!
// @namespace    http://tampermonkey.net/
// @version      0.1
// @match        https://www.dcard.tw/f/whysoserious*
// @grant        none
// @author       Franky
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    // 定義要隱藏的學校名稱
    const blockedSchools = ["國立清華大學", "國立中正大學", "玄奘大學"]; // 自行增減其他學校名稱

    // 使用 CSS 選擇器查找所有文章
    const articles = document.querySelectorAll("article");

    articles.forEach(article => {
        const schoolElement = article.querySelector("a div:nth-child(2)");
        if (schoolElement && blockedSchools.includes(schoolElement.textContent.trim())) {
            article.style.display = "none"; // 隱藏該文章
        }
    });
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址