Skip to content

Twitter: hide tab 'For you' by rybak

Screenshot of Twitter: hide tab 'For you'

Details

Authorrybak

LicenseMIT

Categorytwitter.com

Created

Updated

Size2.2 kB

Statistics

Learn how we calculate statistics in the FAQ.

Failed to fetch stats.

Description

Hides the 'For you' tab on Twitter, optionally hides the tab selection.

Notes

Changelog

  • v7: added support for https://mobile.twitter.com
  • v6: Twitter changed its <nav> tag
  • v5: fixed a bug, which caused editor controls to be hidden
  • v4: cleaned up code formatting
  • v3: simplified code
  • v2: fixed tabs getting hidden in other tab selectors (search, followers, etc)
  • v1: initial release

Source code

/* ==UserStyle==
@name        Twitter: hide tab 'For you'
@namespace   https://andrybak.dev
@version     7
@description Hides the 'For you' tab on Twitter, optionally hides the tab selection.
@homepageURL https://github.com/rybak/
@license     MIT
@author      Andrei Rybak
@preprocessor stylus
@var checkbox hideForYouTab "Hide tab 'For you'" 1
@var checkbox hideTabs "Hide both tabs" 0
==/UserStyle== */

/*
 * Copyright (c) 2023 Andrei Rybak
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */
 
@-moz-document url("https://twitter.com/home") {
	if hideForYouTab {
		main .r-tzz3ar[role="tablist"] div.css-1dbjc4n.r-16y2uox.r-6b64d0.r-cpa5s6:first-child {
			display: none;
		}
		nav.css-175oi2r.r-1awozwy.r-18u37iz.r-1igl3o0.r-rull8r.r-qklmqi > div > div > div > div.css-175oi2r.r-6b64d0.r-cpa5s6.r-16y2uox:first-child {
			display: none;
		}
	}

	if hideTabs {
		main nav.r-1hvjb8t .r-tzz3ar[role="tablist"] {
			display: none;
		}
		nav.css-175oi2r.r-1awozwy.r-18u37iz.r-1igl3o0.r-rull8r.r-qklmqi > div.css-175oi2r.r-1awozwy.r-1ro0kt6.r-18u37iz.r-16y2uox.r-1pi2tsx.r-1ny4l3l {
			display: none;
		}
	}
}

Reviews

No reviews yet.