Greasy Fork

Greasy Fork is available in English.

Memeflag hider

hides memeflags

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Memeflag hider
// @version      0.1
// @description  hides memeflags
// @author       britpol
// @grant        none
// @include      http*://*.4chan.org/pol/*
// @namespace http://greasyfork.icu/users/250780
// ==/UserScript==

(function() {
    'use strict';
    var posts = document.getElementsByClassName("postContainer replyContainer"); //get all posts on page
    for (var currentPostNumber = 0; currentPostNumber < posts.length; currentPostNumber++) { //go through every post on the page
        if (posts[currentPostNumber].getElementsByClassName("countryFlag").length !== 0) { //a post only has countryFlag if it is a memeflag
            ReplyHiding.hide(posts[currentPostNumber].id.substr(2)); //it's a memeflag, hide it.
            //the hide(int postNum) function is called to gracefully hide the post instead of removing it,
            //as 4chan already supports post hiding, this script just automates it.
        }
    }
})();