Greasy Fork is available in English.

Reddit Show Images Marked with Spoiler/NSFW

show images marked with spoiler/nsfw post in reddit

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください。
// ==UserScript==
// @name        Reddit Show Images Marked with Spoiler/NSFW
// @namespace   https://greasyfork.org/pt-BR/users/821661
// @match       https://www.reddit.com/*
// @match       https://new.reddit.com/*
// @grant       GM_addStyle
// @version     1.1a
// @author      hdyzen
// @license     MIT
// @description show images marked with spoiler/nsfw post in reddit
// ==/UserScript==
'use strict';

// Regex for match id image
const regexIdImg = /https:\/\/.*\/(.*)\?/;

// Interval time
const intervalTime = 1000;

// Unblur images
function unblurImages() {
    const imgs = document.querySelectorAll('._2_tDEnGMLxpM6uOa2kaDB3[src*="?blur="]');
    imgs.forEach(img => {
        img.src = `https://i.redd.it/${img.src.match(regexIdImg)[1]}`;
        img.classList.remove('_3oBPn1sFwq76ZAxXgwRhhn');
    });
}

// Unblur images inteval
const interval = setInterval(unblurImages, intervalTime);

// Style
GM_addStyle(`
.m3aNC6yp8RrNM_-a0rrfa:has(> ._2iaYXFpGyyEGq1rp02cl5w[src*="?blur="]) {
    background: unset !important;
    & > ._2iaYXFpGyyEGq1rp02cl5w[src*="?blur="] {
        display: none !important;
    }
}
._2_tDEnGMLxpM6uOa2kaDB3.ImageBox-image._1XWObl-3b9tPy64oaG6fax + ._3jrT7JqZwfGWyxKf4SYuRj {
    display: none !important;
}
`);