Twitter - Auto Show More Replies

Twitter Auto Show More Replies, Included Offensive Contents. 推特自动显示所有回复,包括攻击性内容。

目前為 2024-02-26 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Twitter - Auto Show More Replies
// @namespace    http://tampermonkey.net/
// @version      1.3
// @description  Twitter Auto Show More Replies, Included Offensive Contents. 推特自动显示所有回复,包括攻击性内容。
// @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 showMoreReply = (async (showMoreReplyDiv) => {
    showMoreReplyDiv.click();
});
const nfswClickInterval = setInterval(() => {
    if (document.URL.includes("status")) {
        //Counter
        let i = 0;
        //Normal Tweets
        let showMoreReplyDivs = document.getElementsByClassName("css-175oi2r r-1777fci r-1pl7oy7 r-13qz1uu r-1loqt21 r-o7ynqc r-6416eg r-1ny4l3l");
        //Offensive Tweets
        let showMoreReplyDiv2s = document.getElementsByClassName("css-175oi2r r-sdzlij r-1phboty r-rs99b7 r-lrvibr r-j2kj52 r-f727ji r-15ysp7h r-4wgw6l r-ymttw5 r-1loqt21 r-o7ynqc r-6416eg r-1ny4l3l");
        //Attributes In Tags
        let role = "";
        let tabindex = "";

        //Normal Tweets
        for (i = 0; i < showMoreReplyDivs.length; i++) {
            role = showMoreReplyDivs[i].getAttribute("role");
            tabindex = showMoreReplyDivs[i].getAttribute("tabindex");
            if (role == "button" & tabindex == "0") {
                showMoreReply(showMoreReplyDivs[i]);
            }
        }
        //Offensive Tweets
        for (i = 0; i < showMoreReplyDiv2s.length; i++) {
            role = showMoreReplyDiv2s[i].getAttribute("role");
            tabindex = showMoreReplyDiv2s[i].getAttribute("tabindex");
            if (role == "button" & tabindex == "0") {
                showMoreReply(showMoreReplyDiv2s[i]);
            }
        }
    }
}, 1);