Twitter - Auto Show Sensitive Content

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

Verze ze dne 18. 02. 2024. Zobrazit nejnovější verzi.

// ==UserScript==
// @name         Twitter - Auto Show Sensitive Content
// @namespace    http://tampermonkey.net/
// @version      1.5
// @description  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/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=twitter.com
// @grant        none
// @license      MIT
// ==/UserScript==

const showNsfwDivClick = (async (showNsfwDiv)=>{
    showNsfwDiv.click();
});
const nfswClickInterval = setInterval(() => {
    //Counter
    let i = 0;
    //For Home & Profile--->Tweets
    let showNsfwDiv = document.getElementsByClassName("css-175oi2r r-sdzlij r-1phboty r-rs99b7 r-lrvibr r-173mn98 r-1s2bzr4 r-15ysp7h r-4wgw6l r-ymttw5 r-1loqt21 r-o7ynqc r-6416eg r-1ny4l3l");
    //For Profile--->Media
    let showNsfwDiv_2 = document.getElementsByClassName("css-1rynq56 r-bcqeeo r-qvutc0 r-37j5jr r-a023e6 r-rjixqe r-16dba41 r-1loqt21");
    //Annoying Button
    let hiddenItem = document.getElementsByClassName("css-175oi2r r-sdzlij r-1phboty r-rs99b7 r-lrvibr r-rki7wi r-e1k2in r-u8s1d r-15ysp7h r-4wgw6l r-ymttw5 r-1loqt21 r-o7ynqc r-6416eg r-1ny4l3l");
    //Attributes In Tabs
    let role = "";
    let tabindex = "";
    let dir = "";

    //Click The Show Button On Home & Profile Tweets
    for(i=0;i<showNsfwDiv.length;i++){
        role = showNsfwDiv[i].getAttribute("role");
        tabindex = showNsfwDiv[i].getAttribute("tabindex");
        if(role == "button" & tabindex == "0"){
           showNsfwDivClick(showNsfwDiv[i]);
        }
    }
    //Click The Show Button On Media
    for(i=0;i<showNsfwDiv_2.length;i++){
        role = showNsfwDiv_2[i].getAttribute("role");
        dir = showNsfwDiv_2[i].getAttribute("dir");
        tabindex = showNsfwDiv_2[i].getAttribute("tabindex");
        if(role == "button" & dir == "ltr" & tabindex == "0"){
           showNsfwDivClick(showNsfwDiv_2[i]);
        }
    }
    //Hide The Buttons
    for(i=0;i<hiddenItem.length;i++){
        tabindex = hiddenItem[i].getAttribute("tabindex");
        if(tabindex == "0"){
           hiddenItem[i].style.display = 'none';
        }
    }
}, 100);