Hide Blacklisted Posts on Rule34.xxx

Simple script to hide blacklisted posts on Rule34.xxx

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        Hide Blacklisted Posts on Rule34.xxx
// @namespace   lemusatage
// @description Simple script to hide blacklisted posts on Rule34.xxx
// @version     0.1
// @license     Unlicense
// @match       https://rule34.xxx/index.php?page=post&s=list*
// ==/UserScript==

(function() {
    'use strict';
    const hideBlacklisted = () => {
        const blacklistedPosts = document.querySelectorAll('.thumb.blacklisted-image');
        blacklistedPosts.forEach(post => {
            post.style.display = 'none';
        });
    };
    hideBlacklisted();

    const observer = new MutationObserver((mutationsList, observer) => {
        hideBlacklisted();
    });
    const imageList = document.querySelector('.image-list');
    if (imageList) {
        observer.observe(imageList, { childList: true, subtree: true });
    }
})();