Skip to content

Instantly share code, notes, and snippets.

@mikelei8291
Last active June 28, 2023 13:16
Show Gist options
  • Save mikelei8291/448a47d73b815be7f08c1b47332d66c3 to your computer and use it in GitHub Desktop.
Save mikelei8291/448a47d73b815be7f08c1b47332d66c3 to your computer and use it in GitHub Desktop.
uBO (https://github.com/gorhill/uBlock) rules to remove various distracting elements on Twitter. License: CC0 (Public Domain).
! remove tracking URL params
||twitter.com^$removeparam=/^(s|t)=/
! remove Twitter verification (Twitter Blue) button on left sidebar
twitter.com##a[href="/i/verified-choose"]
! remove suggested tweets under comments
twitter.com##section div[data-testid=cellInnerDiv]:has(h2[role="heading"] + div)
twitter.com##section div[data-testid=cellInnerDiv]:has(h2[role="heading"] + div) ~ div
! remove tweet analytics button under tweets
twitter.com##article div:has(> a[href$="/analytics"])
twitter.com##article div:has(> div[role="button"] svg path[d="M8.75 21V3h2v18h-2zM18 21V8.5h2V21h-2zM4 21l.004-10h2L6 21H4zm9.248 0v-7h2v7h-2z"])
! prevent auto page refresh after idling on background tab
twitter.com##+js(aeld, /^(?:blur|visibilitychange)$/)
! remove right sidebar recommendations (unstable, use with caution)
||twitter.com/i/api/1.1/users/recommendations.json$xhr,1p
||twitter.com/i/api/2/guide.json$xhr,1p
twitter.com##[data-testid="sidebarColumn"] > div > div > div > div > div > div:nth-child(n+4):not(:last-child)
twitter.com##:matches-path(/^\/(?:notifications|i\/)/) [data-testid="sidebarColumn"] > div > div > div > div > div > div:nth-child(3)
! disable copying emoji alt texts
twitter.com##img[draggable=false]:style(user-select: none;)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment