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. 推特自动显示色情暴力内容,不再被模糊化。

目前為 2024-05-17 提交的版本,檢視 最新版本

// ==UserScript==
// @name         X.com (Twitter) - Auto Show Sensitive Content
// @namespace    http://tampermonkey.net/
// @version      1.9
// @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://x.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';
        }
    }
}, 1);

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址