Twitter Sensitive Content Viewer

Simple script to automatically click "Show" on tweets hidden behind the sensitive content warning on Twitter.

Stan na 08-04-2024. Zobacz najnowsza wersja.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         Twitter Sensitive Content Viewer
// @namespace    [email protected]
// @version      1.0
// @description  Simple script to automatically click "Show" on tweets hidden behind the sensitive content warning on Twitter.
// @author       omfgmule
// @match        *://twitter.com/*
// ==/UserScript==

(function() {
    'use strict';

    window.addEventListener('load', function() {
        const revealSensitiveContent = () => {
            document.querySelectorAll('span.css-1qaijid.r-bcqeeo.r-qvutc0.r-poiln3').forEach(span => {
                if(span.textContent === 'Show') {
                    let clickedAlready = false;
                    let target = span.parentNode;
                    if(target && target.click && !clickedAlready) {
                        target.click();
                        clickedAlready = true;
                    }
                    target = span.parentNode.parentNode
                    if (target && target.click && !clickedAlready) {
                        target.click();
                    }
                }
            });
        };

        revealSensitiveContent();
        setInterval(revealSensitiveContent, 100);
    });
})();