Skip to content

Instantly share code, notes, and snippets.

Last active December 17, 2022 11:13
Show Gist options
  • Save ivan/caea21522a563d1413a32b5a95f54638 to your computer and use it in GitHub Desktop.
Save ivan/caea21522a563d1413a32b5a95f54638 to your computer and use it in GitHub Desktop.
Some useful filters you can put into uBlock Origin
! Generic rule to unjustify all justified text. Yes, you really need both rules.
! Test page:
! Test page: (needs !important)
! Test page: (needs !important)
*#$#p:matches-css(text-align: justify) { text-align: left !important; }
*#$#p:matches-css(text-align: left) { text-align: left !important; }
! Set a line-height of 1.5 for <p> and <li> which do not already have a line-height specified by CSS
*#$#p:not(:matches-css(line-height: "")) { line-height: 1.5; }
*#$#li:not(:matches-css(line-height: "")) { line-height: 1.5; }
! Disable the awful "highlight" animation on all forums running Discourse
! Test sites:
*#$#article.onscreen-post > div.row > div.topic-body.clearfix.highlighted { animation: none !important; }
*#$#tr[data-islastviewedtopic].topic-list-item.highlighted { animation: none !important; }
! Horrible CSS-dancing "Share" thing that pops up after selecting text on a Discourse forum
! Look for font stacks that include (consolas|courier|monospace) and force our default monospace font instead
*#$#pre, tt, code, kbd, samp:matches-css(font-family: /\b(consolas|courier|monospace)\b/i) { font-family: monospace !important; }
! Fix for Hacker News, which does not put the first paragraph of a comment into a <p>$#.comment { line-height: 1.5; }
! Discord: no need to let people know we're typing*/channels/*/typing
! 'One tap' Google login on nytimes, quora, etc$subdocument
! Ugly fonts
! Remove the linear gradient covering the article text after load, despite Bypass Paywalls and several uBlock Origin annoyances filters enabled$#div[class]:matches-css(background-image: linear-gradient(rgba(0, 0, 0, 0), rgb(0, 0, 0))) { display: none !important; }
! Hide the 'People also search for' slide-in box when going back on Google Search.
! We require the other attributes here to reduce the risk of false positives.$#div[id^="eob_"][jscontroller][jsdata][jsaction][data-ved] { display: none !important; }
! Fix fonts on$#div#content { font-family: 'system-ui' !important; }
! Fix fonts on$#body { font-family: 'system-ui' !important; }
! Make readable$#body { max-width: 475px; margin: 1em auto; }
! Remove letter spacing on$#p { letter-spacing: 0 !important; }$#html { letter-spacing: 0 !important; }
! Ads and annoyances on criticker > div
! Remove banner on *
! reddit's giant "recommended stories" boxes in comments
! reddit's big signup banner at the top
! reddit's invitation to go chat
! reddit's "go use the new design" banners > .onboardingbar-body > .onboardingbar-body
! Flickr's signup box
! Dropbox signup overlay
! The New Yorker's in-article annoyances
! > div
! sourceforge's "get the latest updates" box
! Video on
! Bottom newsletter banner on
Copy link

ivan commented Dec 17, 2022

These go into 'My filters' in your uBlock Origin settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment