Skip to content

Instantly share code, notes, and snippets.

@ivan
Last active December 17, 2022 11:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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: https://www.addameer.org/israeli_military_judicial_system/administrative_detention
! Test page: https://en.wikipedia.org/wiki/Typographic_alignment (needs !important)
! Test page: https://www.gwern.net/Screwfly (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: https://meta.discourse.org/ https://internals.rust-lang.org/ https://discuss.ipfs.tech/
*#$#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
users.rust-lang.org##.quote-sharing
internals.rust-lang.org##.quote-sharing
! 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>
news.ycombinator.com#$#.comment { line-height: 1.5; }
! Discord: no need to let people know we're typing
https://discord.com/api/*/channels/*/typing
! 'One tap' Google login on nytimes, quora, etc
accounts.google.com/gsi/iframe/$subdocument
! Ugly fonts
*/SourceCodePro-*.*
*/SourceSerifPro-*.*
*/FiraCode-Regular.*
*/FiraCode-Medium.*
*/FiraCode-Bold.*
https://svelte.dev/fonts/fira-mono/*
https://doc.rust-lang.org/*.woff
https://fonts.gstatic.com/s/sourcecodepro/*
https://fonts.gstatic.com/s/googlesans/*
https://fonts.gstatic.com/s/roboto/*
https://fonts.gstatic.com/s/lora/*
https://fonts.gstatic.com/s/firamono/*
https://www.i.cdn.cnn.com/.a/fonts/*
https://qsf.fs.quoracdn.net/*.woff
https://qsf.fs.quoracdn.net/*.woff2
https://qsf.fs.quoracdn.net/*.ttf
https://cdn.jsdelivr.net/font-hack/*
https://abs.twimg.com/fonts/chirp-*.woff
https://abs.twimg.com/fonts/*/chirp-*.woff
! Remove the linear gradient covering the article text after load, despite Bypass Paywalls and several uBlock Origin annoyances filters enabled
www.nytimes.com#$#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.
www.google.com#$#div[id^="eob_"][jscontroller][jsdata][jsaction][data-ved] { display: none !important; }
! Fix fonts on hexdocs.pm
hexdocs.pm#$#div#content { font-family: 'system-ui' !important; }
! Fix fonts on exploringjs.com
exploringjs.com#$#body { font-family: 'system-ui' !important; }
! Make danluu.com readable
danluu.com#$#body { max-width: 475px; margin: 1em auto; }
! Remove letter spacing on without.boats
without.boats#$#p { letter-spacing: 0 !important; }
without.boats#$#html { letter-spacing: 0 !important; }
! Ads and annoyances on criticker
criticker.com###i_bannerad
criticker.com##.i_bannerad
criticker.com###i_cookies
criticker.com###i_plead > div
! Remove banner on *.substack.com
substack.com###nojs-banner
! reddit's giant "recommended stories" boxes in comments
! https://old.reddit.com/r/rust/comments/988euh/how_rusts_standard_library_was_vulnerable_for/
old.reddit.com##.seo-comments
old.reddit.com##.seo-comments-recommendations.spacer
! reddit's big signup banner at the top
old.reddit.com##.listingsignupbar.infobar
! reddit's invitation to go chat
old.reddit.com###chat
! reddit's "go use the new design" banners
old.reddit.com##.redesignbetabar-js.redesignInfiniteScroll.onboardingbar.infobar > .onboardingbar-body
old.reddit.com##.redesignbetabar-js.redesignNightmodeBar.onboardingbar.infobar > .onboardingbar-body
! Flickr's signup box
! https://www.flickr.com/photos/146271943@N06/30935460978/in/explore-2018-09-20/
www.flickr.com##.signup-footer
! Dropbox signup overlay
www.dropbox.com###shared-link-immediate-signup-modal
! The New Yorker's in-article annoyances
! https://www.newyorker.com/science/elements/after-years-of-abusive-e-mails-the-creator-of-linux-steps-aside
newyorker.com###cne-interlude-1 > div
newyorker.com###RecircCarousel
! sourceforge's "get the latest updates" box
! https://sourceforge.net/p/ntfs-3g/ntfs-3g/ci/275edd5353639acfb85e4edb6f203126bf7f0d44/
sourceforge.net###newsletter-floating
! Video on fastcompany.com
! https://www.fastcompany.com/90270691/i-still-miss-my-headphone-jack-and-i-want-it-back
www.fastcompany.com##.siderail-video-module
! Bottom newsletter banner on https://www.cockroachlabs.com/docs/stable/known-limitations.html
www.cockroachlabs.com###newsletter-footer-popout
@ivan
Copy link
Author

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