X.com (Twitter) - Auto Show Sensitive Content

X.com (Twitter) Auto Show Sensitive Content. You Don't Have To Click "Show" Button Anymore When Reading NSFW Tweets With Blur Alert. 推特自动显示色情暴力内容,不再被模糊化。

Από την 01/08/2024. Δείτε την τελευταία έκδοση.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         X.com (Twitter) - Auto Show Sensitive Content
// @namespace    http://tampermonkey.net/
// @version      2.5
// @description  X.com (Twitter) Auto Show Sensitive Content. You Don't Have To Click "Show" Button Anymore When Reading NSFW Tweets With Blur Alert. 推特自动显示色情暴力内容,不再被模糊化。
// @author       Martin______X
// @match        https://twitter.com/*
// @include      https://x.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=x.com
// @grant        none
// @license      MIT
// ==/UserScript==

let $home_show_button = "css-175oi2r r-sdzlij r-1phboty r-rs99b7 r-lrvibr r-173mn98 r-1s2bzr4 r-15ysp7h r-4wgw6l r-3pj75a r-1loqt21 r-o7ynqc r-6416eg r-1ny4l3l";

let $media_show_button = "css-146c3p1 r-bcqeeo r-qvutc0 r-37j5jr r-a023e6 r-rjixqe r-16dba41 r-1loqt21 r-fdjqy7";

let $home_hide_button = "css-175oi2r r-sdzlij r-1phboty r-rs99b7 r-lrvibr r-rki7wi r-42265s r-u8s1d r-15ysp7h r-4wgw6l r-3pj75a r-1loqt21 r-o7ynqc r-6416eg r-1ny4l3l";

let $profile_show_button = "css-175oi2r r-sdzlij r-1phboty r-rs99b7 r-lrvibr r-k200y r-1j93nrh r-1mnahxq r-19yznuf r-64el8z r-1fkl15p r-1loqt21 r-o7ynqc r-6416eg r-1ny4l3l";

const simpleClick = (async (button)=>{
    button.click();
});
const nfswClickInterval = setInterval(() => {
    try{
        //Counter
        let i = 0;
        //For Profile caution
        let profile_show_buttons = document.getElementsByClassName($profile_show_button);
        //For Home & Profile--->Tweets
        let home_show_buttons = document.getElementsByClassName($home_show_button);
        //For Profile--->Media
        let media_show_buttons = document.getElementsByClassName($media_show_button);
        //Annoying Button
        let home_hide_buttons = document.getElementsByClassName($home_hide_button);
        //Attributes In Tabs
        let role = "";
        let dir = "";

        //Profile caution
        for(i=0;i<profile_show_buttons.length;i++){
            let profile_show_button = profile_show_buttons[i];
            role = profile_show_button.getAttribute("role");
            dir = profile_show_button.getAttribute("dir");
            if(role == "button"){
                simpleClick(profile_show_button);
            }
        }
        //Click The Show Button On Home & Profile Tweets
        for(i=0;i<home_show_buttons.length;i++){
            let home_show_button = home_show_buttons[i];
            role = home_show_button.getAttribute("role");
            if(role == "button"){
                simpleClick(home_show_button);
            }
        }
        //Click The Show Button On Media
        for(i=0;i<media_show_buttons.length;i++){
            let media_show_button = media_show_buttons[i];
            role = media_show_button.getAttribute("role");
            dir = media_show_button.getAttribute("dir");
            if(role == "button" & dir == "ltr"){
                simpleClick(media_show_button);
            }
        }
        //Hide The Hide Button On Home & Profile Tweets
        for(i=0;i<home_hide_buttons.length;i++){
            let home_hide_button = home_hide_buttons[i];
            role = home_hide_button.getAttribute("role");
            if(role == "button"){
                home_hide_button.style.display = 'none';
            }
        }
    }catch(error){
        //console.error(error)
    }
}, 1);