Twitter Without Panels

Remove Trending ("What's Happening") and Follow Suggestions ("You Might Like") and Subscribe To Premium panels on Twitter

当前为 2024-08-31 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Twitter Without Panels
// @version      20240831
// @description  Remove Trending ("What's Happening") and Follow Suggestions ("You Might Like") and Subscribe To Premium panels on Twitter
// @author       You
// @match        https://twitter.com/*
// @match        https://x.com/*
// @grant        none
// @run-at       documnet-idle
// @license       MIT
// @namespace https://greasyfork.org/users/1309250
// ==/UserScript==

(function() {
    'use strict';

    setInterval(removeBatch,300); //i coudln't get MutationObserver or waitForKeyElements to work so while(true) it is

   // removeBatch()

    function removeBatch(){
        //removeTrending() //apparently this one just removes itself??
        //removeFollowSuggestions() //and the follow suggestions are the same css as the premium ad
        removePremiumAd()
    }

    function removeTrending(){
        const statisticsText = document.getElementsByClassName('css-175oi2r r-1adg3ll r-1ny4l3l')
        if (statisticsText){
            for (let i=0; i<statisticsText.length; i++){
                statisticsText[i].remove(); //removes statistics text element itself
            }
        }
    }

    function removeFollowSuggestions(){
        const statisticsText = document.getElementsByClassName('css-175oi2r r-kemksi r-1kqtdi0 r-1867qdf r-1phboty r-rs99b7 r-1ifxtd0 r-1udh08x')
        if (statisticsText){
            for (let i=0; i<statisticsText.length; i++){
                statisticsText[i].remove(); //removes statistics text element itself
            }
        }
    }

    function removePremiumAd(){
        const statisticsText = document.getElementsByClassName('css-175oi2r r-kemksi r-1kqtdi0 r-1867qdf r-1phboty r-rs99b7 r-1ifxtd0 r-1udh08x')
        if (statisticsText){
            for (let i=0; i<statisticsText.length; i++){
                statisticsText[i].remove(); //removes statistics text element itself
            }
        }
    }
})();