您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Remove 9gag's terrible promoted posts and some spam
当前为
// ==UserScript== // @name No "9GAGGER" // @namespace http://tampermonkey.net/ // @version 0.10 // @description Remove 9gag's terrible promoted posts and some spam // @author You // @match https://9gag.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=9gag.com // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; let forbiddenAuthors = ["^$", "9gagger", "\\spro"]; let forbiddenText = [ "velma", "woke", "lgbt", "rowling", "wahmen", "wahman", "dark humor", "dark humour", "joe rog", "rogan", "generation", "politics", "climate", "election", "vote", "lula", "bozo", "bolso", "news", "modern", "true", "truth", "qatar", "world cup", "russia", "ukraine", "latest news", "german", "brazil", "brasil", "usa", "war", "russo", "marvel", "mcu", "ariel", "mermaid", "lord of the rings", "rings of power", "lotr", "whame", "relationship", "rekt", "black", "white", "opress", "nazi", "not funny", "religion", "lgb", "gay", "patriarchy", "netflix", "politic", "liberal", "democrat", "libs", "groom", "diversity", "male", "sigma", "alpha", "beta", "based", "politics", "sjw", "trump", "jordan", "peterson", "women", "woman", "girl", "alphabet", "lgbt", "latest news", "alt right", "altright", "leftist", "socialism", "communism", "china", "russia", "ukraine", "covid", "corona", "rona", "she-", "groomer", "sex", "censure", "trans", "cancel", "elon", "musk", "triggered", "trigger", "woke", "repost", "troon", "clown", "tranny", "leftard", "netflix", "feminism", "nazi", "censored", "censor", "cesored", "racis", "gender", "pronoun", "savage", ] let forbiddenRegExp = new RegExp("(" + forbiddenText.join(")|(") + ")", "gi"); let forbiddenAuthorRegExp = new RegExp("(" + forbiddenAuthors.join(")|(") + ")", "gi"); function removePost (post) { console.log("Removing bad post: ", post, post.innerText); post.parentElement.removeChild(post); } setInterval(() => { let posts = document.getElementsByTagName("article"); for (let i = 0; i < posts.length; i++) { try { let post = posts[i]; if (post.dataset.checkedForShit == "1") { continue; // this is a clean post } let text = post.innerText; let authorElement = post.getElementsByClassName("ui-post-creator")[0]; if (typeof authorElement == "undefined") { // promoted post removePost(post); } let author = authorElement.innerText.replaceAll("\n", " ").trim(); if (author.match(forbiddenAuthorRegExp) != null) { removePost(post); } else if (text.match(forbiddenRegExp) != null) { removePost(post); } post.dataset.checkedForShit = "1"; } catch (e) { console.warn(e); } } }, 100); // Your code here... })();