Hacker News new | past | comments | ask | show | jobs | submit login
My uBlock Origin filters to remove distractions (github.com/mig4ng)
469 points by mig4ng on Sept 20, 2023 | hide | past | favorite | 185 comments



Tangentially: after you've blocked a very large number of ads and sidebars, one useful enhancement is to expand whatever text elements remain, to regain use of all that now-empty whitespace. Something like so:

    :xpath(//main/div):style(min-width: 80% !important)
(I've been looking at going a step further for some sites, by annotating a "column-count:" [0] rule and making the screen look like a newspaper. (Narrow columns for readability—multiple columns for "scan-ability"). Unfortunately, there's a lot more fiddling and tuning to this than I expected: it doesn't automagically work in the way you'd hope. Modern website DOM layouts are basically Superfund sites).

[0] https://developer.mozilla.org/en-US/docs/Web/CSS/column-coun...

[late edit]: Here's a minimal example of "column-count:" injected by uBlock (on a website where it sort-of works)—this is what I'm trying to coerce other websites into looking like:

https://i.ibb.co/k3bRwhP/example-1.webp

    theguardian.com###maincontent:style(margin-left: -28vw !important; min-width: 90vw !important; column-count: 4 !important)
    theguardian.com##div:style(border: none !important)


Are you at the point where you should be pouring this content into RSS, and styling it as columns in a reader?

(I really like the column idea, and I'm working back towards RSS, with a bunch of smart filters, being my primary way of interacting with anything I visit regularly. I never should have given it up).


The only reliable way I've found (so far) to shuttle Facebook Pages into something easily to consume (RSS) is unfortunately a paid service... even paid IFTT doesn't support a page posts -> fire webhook/email/etc sadly. Unfortunate, since some local government stuff or otherwise noteworthy stuff is... only available on Facebook. Sometimes it's available on 'X'/Twitter but often not as detailed, or it links to Facebook for more details.


Good point. I've found nothing off the shelf that will work for private groups, and that's the only bit of FB I'm interested in.


It would be cool if you could figure out a way to have this work on top of FF's reader view.


It's possible to style the page Reader View uses by creating new files in FF's folders somewhere...


That works too!

    @-moz-document url-prefix(about:reader) {
      .container {
        column-count: 4;
        min-width: 85vw !important;
        margin: 0 50px 0 50px;
      }
    }
https://i.ibb.co/7XT4zfs/example-2.webp

It's chrome/userContent.css in the Firefox profile subdirectory, enabled by the about:config flag toolkit.legacyUserProfileCustomizations.stylesheets.


I'm quite the fan of various site restylings, using both uBO and Stylus.

But often just switching to Reader Mode is the faster and preferable option.

(This isn't always an option, but frequently is.)


> Stylish

is that the one with a bunch of spyware on it? or is that the one that replaced the one with a bunch of spyware on it


It's the bad one.

Stylus is the good one https://add0n.com/stylus.html


Gah! I meant "Stylus".

The name similarity means I keep getting them confused. Including repeatedly on HN comments.

And yes, I do know the difference: <https://news.ycombinator.com/item?id=36859978>


Typo fixed above.


Thanks!


The first one is a nice trick. Sometimes websites get broken when you remove some elements. Thanks!


If you go to Options > Filter Lists > Annoyances and check mark the following items:

  "AdGuard – Annoyances"
  "EasyList – Annoyances"
  "uBlock filters – Annoyances"
You will get rid of 99.9% of website annoyances without affecting any main functionality of websites.

I've been doing this on every fresh install of Chrome for years. Works wonders.


There really are two different version of the internet, and which one you use depends on how how well your ad blockers are configured.

I was using my mom's laptop over the holidays, and it took me a minute to realize why every site I visited looked so _different_. What I quickly realised is almost every site I visited was wallpapered in ads: banners between every paragraph, sidebars full of ads, and background images selling things. A lot of sites were unrecognizable from what I was used to.


The ads covering the whole background of some websites websites are the most outrageous thing I had the pleasure to discover recently after so much time of ad blocking. They are absolutely aggressive to your very soul.


These people would put ads inside your eyelids if they could. Inside your dreams while you sleep. They have exactly zero limits.


I've long planned a cyberpunk setting where you can sneak past low-level corporate guards by plastering your clothes in ads for competing companies, because their neural interfaces are configured to only let them see their employers adverts.

Every year that plan feels less and less like silly hyperbole.


That's genius! The camouflage of the dystopic future...


I found the ads covering all of the foreground to be more annoying, where you even cannot close them, without opening the link. Pity on those who do not know what a adblocker is and have no one to tell them.


Yeah, browsing the web without uBlock Origin is an extremely shocking experience. I end up installing uBlock Origin in every single browser I come across.

The most aggravating for me is ads that follow me throughout the page as I scroll or show up out of nowhere while I'm reading rudely pushing the text away.


What are people using on their phones these days for ad blocking? (iphone specifically). I absolutely cannot stand any mobile website ever- it's insanity.


Firefox + uBlock Origin on Android makes it impossible for me to consider iOS again.


I’ve been really happy with NextDNS for blocking trackers and ads via DNS for my iPhone. You can create a provisioning profile for iOS and also have the ability to turn the blocking on and off on demand.a

Since iOS doesn’t make it easy to run a flush DNS command, I’ve discovered turning airplane mode on and off will clear your cache.


Which blocklists have you chosen and do they break any sites? Any other tweaks you’ve made? I find it doesn’t block in app or YouTube.


You can use a lot of the same blocklists you can use with uBlock.

I do see less ads in apps with NextDNS. However, I do run into scenarios where certain apps don’t work. For example I know if I want to use DoorDash or Facebook, I need to turn off blocking and flush my DNS cache to run those apps. I don’t see this being a viable option for a nontechnical user.


Here’s the list of the blockers I use in NextDNS: - NextDNS Ads & Trackers Blocklist - AdGuard DNS filter - OISD - AdGuard Mobile Ads filter - EasyList - Steven Black - notracking - AdGuard Tracking Protection filter - Goodbye Ads - EasyPrivacy - NSABlocklist - Disconnect - Fanboy's Annoyance List - Anudeep's Blacklist for ads and trackers



Same, and can't recommend those two enough. I'm a uBlock die-hard on the desktop, but 1Blocker/Hush are very effective.


I recommend 1Blocker. One feature that is rarely mentioned is they can also block some ads in apps and not just Safari, by using a VPN profile which filters trackers locally.

https://1blocker.com


Does it work together with an actual VPN profile?


See “Firewall & other VPNs” on their FAQ: https://support.1blocker.com/en/articles/6436227-firewall-ot...


Brave on mobile has all the popular filters as an option to enable. So all built in, it’s great.


I have 1 blocker premium, adgard, proton vpn blocklist, NextDNS. Out of all of them Brave is best and the only one that consistently blocks YouTube ads (and allowed for background playing).


1Blocker has been solid for me for a couple of years now. I use it on my i-devices and Macs.

https://1blocker.com/


Adguard. The free version works like a charm in Safari on iOS.


I second this. Blocking quality is on par with ubo, never had any issues with it. One of the less hacking, more value apps.


I use Wipr, not so much to block ads but to reduce the chances page content will shift around while loading (to accommodate ad sizes that designers don't bother to plan for). It works pretty well, however it only affects Safari.


NextDNS


Best part is it works for the whole device, not just specific apps.


Cromite, but not for iPhone


"Orion" is developed by the people at Kagi, free, and blocks a lot. As soon as I'm earning a salary again, I'll be supporting them financially; super valuable.


Actually uBO can be installed in Orion.

Orion supports firefox and chrome plugins and runs on iOs


This is news to me. Kagi/orion just got me to jump to their paid search engine.

Previous was using 1Blocker on safari but ublock origin on Orion is much more effective.


>What are people using on their phones these days for ad blocking?

uBlock Origin of course, what else? Running on Firefox (Nightly).

>(iphone specifically)

If you want an iPhone, you shouldn't complain about ads. If you want to block ads, get an Android. If Apple wanted you to block ads, they'd build a good ad-blocker into their phone. They don't, and they forcibly prevent you from using a different browser and ad-blocker, so obviously they want you to view ads.


I've been using uBlock Origin for years & never saw these settings. Thank you for sharing!


I really have to try enabling this and surfing for a couple of days to see the difference :)

Thanks!


Is AdGuard better than easylist?


They're complementary.


If you use uBlock Origin, did you try to submit these filters to the uBlock Annoyances[1] or EasyList Annoyances lists before starting up this project?

That would help far more people that starting up yet another Annoyances list.

1. https://github.com/uBlockOrigin/uAssets


These aren't just annoyances, they are core features of the sites.


Might be scope for upstream projects to add a new group like "uBlock Focus" where blocks are to focus main content?

Before IT took away all plugins (!) I used uBlock this way, hiding sidebars and leads that weren't conducive to work (eg interesting stuff).


> Before IT took away all plugins

They really like dealing with users and their malware infections I guess. It's the only possible explanation given that uBlock Origin is probably the most effective anti-malware software in existence.


>Before IT took away all plugins

weird decision, I push plugins to lots of my customers (uBlock Origin)


indeed, one could argue a reputable adblocker is paramount to endpoint/enduser security these days



So? Any corporation would argue that about the annoyances on their properties.


I thought people used those list because it cleaned up the websites without breaking them. This is largely breaking the websites, only letting through a very opinionated subset of functionalities.

Even if it's nice for people who want just this, I don't think this has its place on the annoyances lists you mentioned.


No they wouldn't?

Annoyances are mainly for things like cookie popup or copy-protection etc. I doubt companies would argue these are their "core features".


the main timeline is a core feature of twitter for most people.


why not both? the site pushes their features, the user filters their annoyance and we all normalize the wasted resources.


PSA: Some annoyances lists can be zealous about removing from websites any visual cue indicating the availability of an RSS feed.


I strongly suspect that those get caught up on "social" or "sharing" icons, often indicated by a "social" class, or "share-daddy" specifically (I block that last a heck of a lot myself).


I didn't know about this. Might add them to my filters, and see if mine apply there too. Thanks.


Some people here bring up some good criticisms of my comment. Perhaps it would be more focused to call your list "Distractions" or some such.

I certainly buy their stance that these are different from what are traditionally on the Annoyances lists.


Personally I have to hide Stack Exchange’s trending questions on my work machine. Those things are catnip to me.

  askubuntu.com###hot-network-questions
  serverfault.com###hot-network-questions
  stackexchange.com###hot-network-questions
  stackoverflow.com###hot-network-questions
  superuser.com###hot-network-questions
Also many sites disregard prefers-reduced-motion, so I’m often hiding visual distractions like endless carousels and cute decorative animations.


> Those things are catnip to me

lol, I go over to try and solve a react component lifecycle question, and then click over to a Dungeons And Dragons esoteric rule edge case.


for the longest time, i never paid attention to that column, as my brain has pretty much been trained that anything in that column is useless fluff. until one day when i actually read some of those questions and was surprised by the questions being asked. i totally get the catnip. luckily, i have an off switch and can avoid becoming addicted.


Same here! Although my rules look a bit different because I simply use the element picker:

    stackoverflow.com##.c-pointer.js-quack-btn
    stackoverflow.com##.js-step01.js-step.step.ws-nowrap
    stackoverflow.com##.js-step02.js-step.step.has-width.ta-center
    stackoverflow.com##.quack-popover--arrow
    stackoverflow.com###overlay-header
    stackoverflow.com###feed-link
    stackoverflow.com##.mb16.s-anchors__default.s-anchors.s-sidebarwidget__yellow.s-sidebarwidget
    stackoverflow.com##.grid--cell.js-reactions
    stackoverflow.com##.mb16.s-anchors__grayscale.s-anchors.s-sidebarwidget__yellow.s-sidebarwidget
Unfortunately, I also didn't comment what these are all for. But I think one of them is the banner, which might contain calls for voting and such. Another is the "Featured on Meta" box and the sidebar on the left which I never use. And the most recent thing, which isn't included above is the obnoxious popup for the "New Search AI Experience".

And this does not even include the goddamn cookie banners, for which ublock has a separate rule set fortunately. Unfortunately, it's the rule set that leads to the most problems because some sites don't work correctly or don't load at all when the cookie banner has not been interacted with. I hate the modern internet without ublock.


These with generated ids and classes might be hard to maintain. If you like to change those to the classes/ids that are human readable and easy to maintain, and comment them, feel free to contribute them here: https://github.com/mig4ng/ublock-origin-filters/pull/4

Thanks for sharing.


These are awesome, feel free to contribute to the StackOverflow PR in the repository: https://github.com/mig4ng/ublock-origin-filters/pull/4


I use something similar to this, the only differences are because my use case is privacy protection and avoiding algorithmic feeds. I use the Redirector extension for Firefox so that it redirects e.g. Youtube, Twitter, and StackOverflow links to the corresponding alternative frontends Piped, Nitter, and AnonymousOverflow. You can find maintained lists [1] [2] of such projects and their instances. Mostly they are FOSS and privacy-respecting, and they have distraction-free frontends because it's a helpful coincidence of being ethical software.

[1] https://github.com/digitalblossom/alternative-frontends [2] https://farside.link


This is amazing. I had similar ideas in my bucket list of creating distraction free alternatives and redirecting somehow.

Happy to know someone had the same idea and there are versions of it online. Thanks for letting me know of this, I really appreciate it!


A while back I worked out how to erase the pay-to-win monetization spoor from Reddit and Twitter,

    reddit.com##.awarding-icon
    reddit.com##.awardings-bar
    reddit.com##.give-gold-button
    
    twitter.com##:xpath(//div[contains(@style, "hex-hw-shapeclip-clipconfig")]):style(clip-path: circle(50%) !important)


Reddit has ended awards (for now). The filter is still applicable for older posts though.


What does the last one do?


I don't know if they still do it, but at the time Twitter charged money to display user avatars in a larger size, and styled as a hexagon. I think they were NFT tie-ins or something? They were difficult to ignore, so I wrote a snippet to turn hexagons back into circles.

[edit]: https://news.ycombinator.com/item?id=30012904 ("Twitter Rolls Out NFT Profile Pictures")


I had an extension (that I found here) that transformed all NFT avatars into Jared from Subway. It really takes the edge off of whatever they say. Even the most serious arguments just turn into kids' spats with that picture, it made the site more pleasant to be in.


Never seen it, if I do and it bothers me I will keep in mind and add this too. Thanks!


This one gets rid of the Login With Google popups that have infested most corners of the internet:

   accounts.google.com/gsi/iframe
It doesn't break the login with google button, so you can still login with your google account, if you must.


Will try it and might add it too, I find those annoying. Thanks!


FYI you can turn those off in Google's account settings: https://support.google.com/accounts/thread/219332922/how-to-...

Which of course implies that you have to be logged into Google for it to work, doesn't apply to incognito windows, etc.


Just did this, thanks. But having it in ublock is good too :)

I have added the rule to the repository


Here's my filters in ublock origin for Hacker News:

    news.ycombinator.com##.comment:style(max-width: 70ch !important; overflow: hidden !important;)
    news.ycombinator.com##.c00:style(color: #3f3f3f !important;)
    news.ycombinator.com##.comhead:style(background: #e6e6df; font-weight: italic; color: #686868 !important;)
    news.ycombinator.com##.hnuser:style(background: #e6e6df; font-style: italic; color: #575757 !important;)
    news.ycombinator.com##html:style(filter:invert(100%) hue-rotate(180deg); background: white)
Restricts width of comments so that they're about 10 or so words wide, for optimal reading. Also changes some of the colours.

Experiment with the above, and if you have any improvements please let me know!


I don't know you can add styles with uBlock filters.

I probably still prefer to just use Stylus for better readability/debuggability, but it's good to know.

Edit: BTW I think `font-weight: italic;` is a typo.


whoops! Thank you for spotting that. :)


I'm using uBlock similarly! I've accumulated hundreds of custom filters for the past eight years. My newest entries on uBlock's "My Filters" tab are for hiding spoilers on IMDb:

  ! 2023-09-05 Hide episode's description and image (+ watchlist for not breaking the layout) [new experimental IMDb layout]
  imdb.com##article.episode-item-wrapper .ipc-slate
  imdb.com##article.episode-item-wrapper .ipc-html-content
  imdb.com##article.episode-item-wrapper .ipc-watchlist-ribbon

  ! 2023-09-05 Hide top rated episode's description both on a TV page and an episode page
  imdb.com##[data-testid="episodes-top-rated-card"] ul + div


Might want to also hide the number of episodes an actor is in the show for. That’s bitten me a few times.


Do you have the others open sourced? Mind sharing them?


Arc has native support for cosmetic improvements. Those are called Boosts and you can interactively create your owns in just a few clicks, and also add custom CSS/JS if needed.

I use this extensively to declutter/dedistract most websites I visit: Facebook, Twitter, Reddit, Medium, Gmail, YouTube, and so on. It's a real life-changer!

See the Boosts shared by other users here: https://arc.net/boosts


I really like the vertical tabs of Arc. I have actually used Firefox vertical tabs with nested tabs in the past and I loved the worflow.

Being able to have the rabbit whole of tabs when you are going deep on some topic very self contained is awesome. When I am finish, closing the group would clean all my tabs except the ones I wanted in the first place. I miss that.

I do not use it right now because it took me some time to setup, and there was no easy way of making it declarative (as code) for sharing across devices and keeping the config for future use. I might try it again if I find a way.

In regards to Arc, I gave it a go, but I dislike some things:

- It is not open source, neither the boosts, as it appears.

- It is Chromium based. I want Firefox or others to keep having a share in the market. I don't dislike or hate google, but I do not want a company to dominate the web (might be too late?).

- Only available in macOS, iOS ?! Not sure if it is still the case.


Arc is the best browser UI thus far. Everything else is still stuck in the late 2000s essentially


Roughly around when the oligoculture started, and browsers stopped being "user agents", what a coincidence!

We need more browsers that focus on user features, not website features. The web is basically beyond feature-complete already, but the tools we use to interact with it are so basic. Like riding a horse on an interstate!


Some would claim that is a feature. Though personally i'm trying hard(ish) to make Firefox' UI closer to early 2000s :-P (thanks to userChrome.css).


Arc's pretty great, but I wish it had nested vertical tabs a la Orion.


That feature wasn't big to my browsing style, Arc's way of nesting browser views suits me more, but Orion's Saved Window feature seemed clumsy to me and I'd filed my issue on Orion Tracker.


I didn't know Orion existed. Just tried and it is exactly what I want.

Excited to see where it goes. Hope Arc and Orion eventually decide to go open source.


> Hope Arc and Orion eventually decide to go open source.

From Orion’s FAQ:

> Is Orion open-source?

> We’re working on it! We’ve begun with some of our components and intend to open more in the future.

> Forking WebKit, porting hundreds of APIs and writing a browser app from scratch has been challenging for our small team. Properly maintaining an open-source project takes time and resources we’re short on at the moment, so if you want to contribute at this time, please consider becoming active on orionfeedback.org.

https://browser.kagi.com/faq.html#oss


This is cool. I did something similar at one point. Unfortunately these websites change their basic layout so often that it felt like these fixes would work for 1 month max then I'd have to configure again.

I ended up moving to news feed eradicator. https://chrome.google.com/webstore/detail/news-feed-eradicat...

I let myself use reddit for 5 minutes every morning. It auto blocks the feed when those 5 minutes are up. Every other site I just leave blocked.


> "Unfortunately these websites change their basic layout so often that it felt like these fixes would work for 1 month max then I'd have to configure again."

You're exaggerating. My userContent.css is 60kB, and although breakages do happen indeed, it's occasional and nowhere near "redo everything every month".

What I will reckon is a pain, are machine-mangled CSS classes (e.g. by packers for React / other frameworks). They are kinda stable, until they're not, and at any rate, their inscrutability makes maintenance more difficult (because .user-profile-picture is human-transparent, while .cD5aZf is not :-/ ).


Judging by some of the other examples here I’m guessing this is a case of writing fragile rules that e.g. count n and m items into a tree and test unnecessarily for incidental classes. If all you do is accumulate the often senseless outputs of the element picker I’d expect the gains to be short-lived.


Indeed, 100%. I learned to never do such things, and would rather not have a rule than have a brittle one. This explains that my experience differs from OP's.


There are better ways to do it. For example, you can match elements containing specific text, such as the text that introduced the annoyance. On NewEgg you might match the text “Download our app” and use it to remove that whole box.


Yup yup.

- Standard CSS (for userContent.css): https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_s...

- uBlock Origin: https://github.com/gorhill/uBlock/wiki/Static-filter-syntax & https://github.com/gorhill/uBlock/wiki/Procedural-cosmetic-f...

Still, sometimes it's difficult/impossible to make a reliable filter, and in such cases I'd rather not have it than have a brittle one.


Yes, I feel the same. Even though I still have some brittle rules, I avoid most and prefer filtering for specific text or classes/ids and find the correct element from there. Before I did not use uBlock to filter elements that much because I used the filter.

I wonder if you have your filter rules open source or available somewhere. Please share.


I didn't make the effort to share them, sorry. That being said,

1. My rules are not any different from yours. I doubt you'll learn much from them given what you're already doing in your repo.

2. I feel that the "what to hide" / "not to hide" choice is too personal to be reusable by anyone else. I'm sure some of the stuff I hide will be considered excessive, and some will be considered missing. What I enjoy in this HN thread is that we share the { practice, tools, docs, tips }, then to each their own :)

3. I'm not interested in maintaining a public repo of that kind of stuff, and/or replying to Issues. So, would rather not make it public.

Sorry/notsorry ¯\_(ツ)_/¯ , at any rate, glad we're sharing tips around the practice.


The repository I shared is very opinionated and I will decide what goes in or not (a benevolent dictatorship). I want to make it easy for me to maintain, and others to use/fork if they want.

You could share them publicly without having the burden of replying to issues/PRs etc. But I get you.


Thanks! I do this all the time too :) . Makes for a more pleasant / less cluttered experience on sites I use a lot.

I'll add that another thing that is pretty easy to do is to add a Dark Mode to websites that don't have one. All you need is a userContent.css/uBlock rule like

    @media (prefers-color-scheme: dark) {
        body {
            background-color: #111 !important;
            color: #eee !important;
        }
        /* etc, more stuff here depending on site */
    }
, and ta-da! Dark mode respecting your OS dark/light setting based on pref or time of day :)


Dark Reader extension does basically this (I think they either change colors or add the invert filter depending on what looks better?), but also has builtin CSS override rules for many sites. Love it.


Sure. I prefer to minimize depending on more extensions (for futureproof-ness, performance, security). These days, { uBlock Origin, Vimium } is all I need :)


That's a nice approach! I try to maintain a practical balance here, my extension list is basically: GreaseMonkey, Stylus, uBlock Origin, Consent-o-Matic, Dark Reader and maybe a couple more.

In theory, one can use uBlock0 for everything (with CSS and I think also JS injection), but userstyles and userscripts are way easier to use sometimes. And you can reimplement Dark Reader with userstyles, but you'll have to keep track of various site-specific tweaks to make it look good. (Should be possible though! Might be a cool idea for a pet project.)

But I understand the concerns with having too many extensions from too many different authors, yeah.


Thanks for sharing. I don't use Dark mode but someone might be interested in this!


For read only I really like these privacy friendly alternatives:

Twitter, completely skinned down to just the content and no login nags:

Nitter - https://nitter.net - https://github.com/zedeus/nitter

Youtube, also very skinned down and you can also collapse recommendations by default etc.:

Piped - https://piped.video - https://github.com/TeamPiped/Piped

Invidious - https://invidious.io - https://github.com/iv-org/invidious/

Stackoverflow, also completely skinned down to just the content and nothing more:

AnonymousOverflow - https://code.whatever.social - https://github.com/httpjamesm/AnonymousOverflow

For all of these I use LibRedirect to redirect the original pages to the open source/privacy friendly frontends:

https://libredirect.github.io/


Thanks! I just tried Invidious and like that it works even without javascript, although videos are limited to 720 resolution. Search works and you can even load some of the YouTube comments without javascript.


Mostly I'm using one of the default uBlock origin ones, but custom rules that have made (desktop) Facebook much pleasanter for me:

  www.facebook.com##div:nth-of-type(8):has-text(Suggested for you)
  www.facebook.com##div:nth-of-type(8):has-text(Reels and short videos)


I don't really use facebook these days, but thanks for sharing. I might add them if I ever step into a facebook post that I want to see and they annoy me :)


There is also https://letsblock.it/filters, a collaborative repository of uBlock content filters, to which I encourage you to contribute your own ones.


I found that and I actually link it in the repository. I will investigate it later.


I use similar filters in my uBlock origin. I like this approach because it avoids installing more browser extensions, each of which risks security or privacy issues.


Please share them to see if I can improve mine :)


I do a lot of the same things to remove sidebars, navigation, suggestions, search, etc from various sites. There are a couple of web comics where I nuke everything but the image and the next/previous navigation links (Order of the Stick, Schlock Mercenary, etc).


Feel free to share them in the repository via PR, issue, or here :) Thanks.


Interesting. I wonder how hard would be to create a filter to programmatically eliminate certain sellers from Ebay query results, say those known for selling counterfeit hardware, those with feedback ratings below a given threshold, etc.


Unfortunately the search results page doesn't appear to include the seller id or username for the items.

However if you had a list of usernames to exclude eBay lets you do that in the advanced search.


I've written so many of these. Any reason you chose uBlock over something like userstyles?

I'd like to open source/release my styles but I'm not sure which is the best choice.

uBlock is great for blocking things from loading (like images) but for visual updates I prefer CSS.


Not OP, but I use ublock origin for a small number of visual tweaks. I use ublock origin because I don't want to use an extra extension.


I am just using it to remove elements, not visual tweaks, at least for now.

Also, I try not to have many configurations/extensions extra that I have to install in a new machine. As I did not find a good way to manage these configs as code.


Using rules to completely block shorts from appearing in any YT feeds (and rules to fix the feeds so they don't look broken afterwards) has been great. YT breaks it from time to time with a UI update, but it's something I'll always use. I hate YT Shorts


Share yours on the repo via issue/PR or share them here. Thanks!


I didn't create them myself, to be clear, I originally got them from here and have adjusted over time (some comments on this thread / other similar threads discuss the changes necessary due to breakage): https://www.reddit.com/r/uBlockOrigin/comments/143mdqv/code_...

I'll come back later when at home and post the rules I currently use as I've had to manually block other things (new carousels showing up in recommended, etc)


Thanks for sharing!

I've been doing this for the last year with YouTube. YouTube is just a search bar now which prevents mindless browsing and distractions.

If I find myself using a site mindlessly I add it to my /etc/hosts file to block them.


You should submit these rules to https://letsblock.it ! AFAIK their distractions rules really only cover YouTube


I have checked them, I have to try them. Also I referenced them in the repository. Thanks :)


Needs blocks for Stack Exchange hot questions


There's https://github.com/httpjamesm/AnonymousOverflow. I made https://doublefault.mhasbini.com/ before I knew about it. On the plus side it keep default aesthetics.


Oh yes, they are annoyingly interesting, which is fine when I am browsing for fun, but usually I go to StackExchange for a very specific problem and then suddenly, uups, where am I?


Here are the rules I’ve been using for Stack Exchange; you can see that I have been doing this for a while. Some of these may no longer even be necessary…

    ! 5/8/2018, 9:16:29 AM https://emacs.stackexchange.com/questions/13080/reloading-directory-local-variables
    emacs.stackexchange.com###overlay-header
    ! 3/31/2020 https://emacs.stackexchange.com
    emacs.stackexchange.com###divQuestionFollowFeaturePopover
    ! 2021-04-14 https://emacs.stackexchange.com
    emacs.stackexchange.com##.js-teams-promo
    ! 2021-08-14 https://emacs.stackexchange.com
    emacs.stackexchange.com###hot-network-questions
    ! emacs.stackexchange.com###sidebar
    ! 2021-10-01 https://emacs.stackexchange.com
    emacs.stackexchange.com##.js-create-team-cta
    ! 2022-09-18 https://emacs.stackexchange.com
    emacs.stackexchange.com##.s-sidebarwidget:not(.js-review-actions)
    emacs.stackexchange.com##.js-feed-link
    ! 2022-12-18 https://emacs.stackexchange.com
    emacs.stackexchange.com##.icon-winterbash
    ! 2023-07-28 https://emacs.stackexchange.com
    emacs.stackexchange.com##.js-announcement-banner


That's true, feel free to open PR, or I might eventually add them too.


Love this! I've been working on one for pull quotes: https://codeberg.org/oneirophage/filter-list-pull-quotes


+1 for UnHook. Amazing how the experience of youtube changes when all you can see is a search bar and the current video


I have been using it for years now, it is perfect. Main reason I will still keep it because it works.

Removing an extension from my list would be great but it is amazing as is.


There's an irony of me getting distracted from what I should be doing by looking at ditraction filters...


Just think how undistracted you’ll be after you spend a few hours tweaking your filters!


I have a habit of creating filters to hide away footers in all sites I browse regularly. Modern SEO practices have made footers entirely useless, so I just zap them away for a lighter look.


I would suggest the author to explain, briefly, how to use the filters in uOrigins in the README.


Thanks for the suggestion, added it :)


I've been using uBlock to remove or revert the "improved designs" as much as possible.

Really like the click to remove (and build a filter) to aid in this effort.


Tangentially related: Has anyone tried the Orion Browser by Kagi for iOS?

https://browser.kagi.com/

They claim to support Firefox and Chrome extensions (specifically, uBlock Origin). It's in beta. I'm surprised Apple hasn't blocked it yet, but I'd consider paying for a developer account just to install it on my phone (assuming it works).


Ive been using it on my laptop and phone. The phone version doesnt feel like it has enough polish yet. You can install it from the app store BTW, no need for a developer account. Ive been having problems with the app crashing, being unresponsive. However, the Mac version works 100% for me. I have ublock origin, bitwarden, bypass paywalls clean and sponsorblock installed. I havent noticed any issues and im very satisfied. I also really love the programable buttons feature, which let you define a button in the toolbar that runs some JS when you click on it (like a bookmarklet).


Just tried it and it seems pretty cool. I hope they go open source as stated in the FAQ.

Also would love to see a similar browser with vertical tabs for Linux/Windows.


uBlock Origin works on Orion for Mac (running forked WebKit), but does not work on Orion for iOS (because of Apple's limitations on iOS).


I've been using Proxomitron (a MITM proxy) to filter sites and have accumulated plenty of filters over the years, but unfortunately it doesn't seem there's an easy way to convert between the filtering systems; uBlock and similar in-browser extensions work on document structure (DOM), while Proxomitron is basically an application-specific-regex syntax search-and-replace.


I use StopTheMadness on Safari and have a lot of similar custom things.

For Linkedin I use to get rid of the feed:

.scaffold-finite-scroll__content { display: none }


I have that one in uBlock origin.


I've been looking for something like this solution for a while. Never thought of using ublock filters. Cheers


You definitely should add news.ycombinator.com, all of it :)


I block only the "firehose" pages so I can continue to run search-engine queries over HN (using hn.algolia.com):

  ||news.ycombinator.com/|
  ||news.ycombinator.com/news^$document
  ||news.ycombinator.com/newcomments^$document
  ||news.ycombinator.com/newest^$document
  ||news.ycombinator.com/classic^$document
  ||news.ycombinator.com/front^$document
  ||news.ycombinator.com/bestcomments^$document


Maybe you'd like noprocrast mode? Limits use time.

It's in your user config, click your username.


I do have it, just the homepage, /news, and /newest. Haven't added to the repository yet but will probably soon.


One of the most useful is removing home page clutter on youtube:

  youtube.com##ytd-browse[page-subtype*='home']

  m.youtube.com##ytm-browse > ytm-single-column-browse-results-renderer > div > div[tab-identifier*="FEwhat_to_watch"]


Please someone do shareable Twitter users ABP-based user KILL LIST, like in Usenet had!


Could you elaborate?



Doesn't block do this already?


Not shareable. Common block lists would be awesome!


I tend to associate the tweaks on the site with Tampermonkey and not uBlock Origin.


This there any way to use this list in AdGuard? I tried adding it, but it showing up as having zero rules. (I am on iOS, so no uBlock Origin for me)


My filter to make all elements square (I don't like today's trend of making everything rounded):

##:style(border-radius: 0px !important)


Between Firefox for Android and uBlock, i dub this guy a literal saint. Truly good stuff. Havent seen a yutube or otherwise ad in a while.


NB: Before/after screenshots are highly useful when pitching or demonstrating something such as this.


If someone has some filter strings to help clean up Etsy search results, that would be appreciated.


newsfeed eradicator extension is a more configurable way to achieve similar features


I have used it in the past, it does not give me the same flexibility. It might have changed over the years. I have used it long ago. Thanks for sharing.


Personally, I can't stand how distracting YouTube thumbnails are. I found this list to block them from the sidebar when watching videos.

  ! Hide all of the recommended videos on the right side of the page, except for the first up-next video.
  ! If you have a tall monitor you may need to add more entries, this blocks the initial list on most resolutions.
  www.youtube.com###items > .ytd-watch-next-secondary-results-renderer.style-scope:nth-of-type(2)
  www.youtube.com###items > .ytd-watch-next-secondary-results-renderer.style-scope:nth-of-type(3)
  www.youtube.com###items > .ytd-watch-next-secondary-results-renderer.style-scope:nth-of-type(4)
  www.youtube.com###items > .ytd-watch-next-secondary-results-renderer.style-scope:nth-of-type(5)
  www.youtube.com###items > .ytd-watch-next-secondary-results-renderer.style-scope:nth-of-type(6)
  www.youtube.com###items > .ytd-watch-next-secondary-results-renderer.style-scope:nth-of-type(7)
  www.youtube.com###items > .ytd-watch-next-secondary-results-renderer.style-scope:nth-of-type(8)
  www.youtube.com###items > .ytd-watch-next-secondary-results-renderer.style-scope:nth-of-type(9)
  www.youtube.com###items > .ytd-watch-next-secondary-results-renderer.style-scope:nth-of-type(10)
  www.youtube.com###items > .ytd-watch-next-secondary-results-renderer.style-scope:nth-of-type(11)
  www.youtube.com###items > .ytd-watch-next-secondary-results-renderer.style-scope:nth-of-type(12)
  www.youtube.com###items > .ytd-watch-next-secondary-results-renderer.style-scope:nth-of-type(13)
  www.youtube.com###items > .ytd-watch-next-secondary-results-renderer.style-scope:nth-of-type(14)
  www.youtube.com###items > .ytd-watch-next-secondary-results-renderer.style-scope:nth-of-type(15)
  www.youtube.com###items > .ytd-watch-next-secondary-results-renderer.style-scope:nth-of-type(16)
  www.youtube.com###items > .ytd-watch-next-secondary-results-renderer.style-scope:nth-of-type(17)
  www.youtube.com###items > .ytd-watch-next-secondary-results-renderer.style-scope:nth-of-type(18)
  www.youtube.com###items > .ytd-watch-next-secondary-results-renderer.style-scope:nth-of-type(19)
  www.youtube.com###items > .ytd-watch-next-secondary-results-renderer.style-scope:nth-of-type(20)
  
  ! Prevents the list of recommendations from expanding when scrolling down.
  www.youtube.com##ytd-continuation-item-renderer.ytd-watch-next-secondary-results-renderer.style-scope
  www.youtube.com###continuations > .ytd-watch-next-secondary-results-renderer.style-scope
  www.youtube.com##.use-ellipsis.ytd-watch-next-secondary-results-renderer.style-scope
  www.youtube.com##ytd-compact-playlist-renderer.ytd-watch-next-secondary-results-renderer.style-scope
Also, if you hate Shorts as much as I do, use this to hide them from appearing in search results.

  youtube.com##ytd-rich-section-renderer:has(#rich-shelf-header:has-text(Shorts))
  youtube.com##ytd-reel-shelf-renderer:has(.ytd-reel-shelf-renderer:has-text(Shorts))


I’m not very familiar with YouTube but can’t that enormous list be condensed to youtube.com###related?


Yes, you can replace it with:

www.youtube.com###items > .ytd-watch-next-secondary-results-renderer.style-scope:nth-of-type(n+2)

This will block the 2nd item and onwards. Note, YT seems to use display:none for behaviour and will fetch up to 160 records for every page, 20items at a time.


Admittedly, I was lazy and didn't bother to play around or experiment after I had copied it. This is a nice update.



Would be cool to see some examples



Like screenshots?


Not OP, but here's a screenshot illustrating what I personally typically do on sites I use a lot: hide things, make things low opacity until hovered, add a dark mode if missing. https://imgur.com/a/tCFkVzK

EDIT should have installed uBlock on the left/default browser for a fair comparison. Oh well, you get the idea :)


Lucy?


Ahah, yes I like Disenchantment a lot. Haven't watched the latest season though.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: