Twitter Without Panels

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

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==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 elements = document.getElementsByClassName('css-175oi2r r-1adg3ll r-1ny4l3l')
        if (elements){
            for (let i=0; i<elements.length; i++){
                elements[i].remove(); //removes element itself
            }
        }
    }

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

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