TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Let's Block It – Custom uBlock Origin Filters Made Easy

261 pointsby xvelloover 3 years ago
uBlock Origin is more than an ad-blocker, it&#x27;s a general purpose content filter that can be leveraged to hide low-quality content from pages you browse. While the main filter lists can remove mailing list popups and obvious nags, the definition of low-quality content is personal, so one size cannot fit all.<p>I used to have an ad-hoc script to render and publish a personal uBlock Origin filter list, added to all my browsers. The goal of this project is to enable more people to build such a list custom list to filter out low-quality content and nags. Chose from a list of community-maintained templates, set your options, add your custom rules, and get your personal filter list.<p>Code and content are licensed under the Apache 2.0 license and hosted on <a href="https:&#x2F;&#x2F;github.com&#x2F;xvello&#x2F;letsblockit" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;xvello&#x2F;letsblockit</a>. The project is still pretty young and needs more filter templates, and lots of frontend improvements (my last web project was in 2005, this is not my forte). Any feedback is welcome!

24 comments

perihelionsover 3 years ago
It&#x27;s fascinating to browse HN history and see what uBlock rules HN&#x27;ers have considered worth writing comments about. The unique syntax makes it very easy to find those:<p><a href="https:&#x2F;&#x2F;hn.algolia.com&#x2F;?query=%23%23%20ublock&amp;type=comment&amp;dateRange=all&amp;page=0&amp;prefix=false&amp;sort=byPopularity" rel="nofollow">https:&#x2F;&#x2F;hn.algolia.com&#x2F;?query=%23%23%20ublock&amp;type=comment&amp;d...</a><p>(&quot;## ublock&quot;)
评论 #30066329 未加载
bambaxover 3 years ago
Personal customized filters are a great idea! Congrats!<p>Here&#x27;s something that might help others. On Whatsapp groups some users can become obnoxious, and one can fall into the trap of responding to their trolling. Yet AFAIK it&#x27;s impossible to hide contributions from a given user in a group; one can only leave the group.<p>When using WhatsApp in the browser, a uBlock filter can hide contributions from a given user like this:<p><pre><code> web.whatsapp.com##div.message-in:has(div.copyable-text[data-pre-plain-text*=&quot;name_of_user&quot;]) </code></pre> This hides text messages (even successive ones where the username isn&#x27;t displayed) but doesn&#x27;t hide messages with only images or other media. For those it&#x27;s more difficult as the username is in a span that has no consistent characteristics; the username has to be unique and complete in order to not trigger false positives.<p>Or maybe there&#x27;s a better way. Suggestions welcome.
评论 #30064933 未加载
lordnachoover 3 years ago
Still waiting for one that blocks FB ads. I gather Meta spends a lot of effort to make it hard though, contrary to most sites I&#x27;ve come across. Makes sense given their business model, I don&#x27;t doubt that.
评论 #30063577 未加载
评论 #30066365 未加载
评论 #30068567 未加载
评论 #30064310 未加载
评论 #30062628 未加载
评论 #30063453 未加载
jakub_gover 3 years ago
Side note: this remembered me back in late 2000s there was a Firefox extension called RIP (Remove It Permanently) for the same use case. And Aardvark (later: HackTheWeb) for cleaning temporarily (before printing etc). IIRC they didn&#x27;t survive gradual Firefox engine changes between v20 and v57. Anyway, good old times.
评论 #30066255 未加载
Melatonicover 3 years ago
If you want to get really fancy run uBlock in browser + NextDNS + block the IP&#x27;s of all commonly known DNS on your router firewall. Then make sure everything (browsers, networking hardware, mobile devices) is doing DoH or DoT to NextDNS.<p>This way smart devices and apps cannot hardcode an IP for encrypted DNS to get around your DNS settings.<p>Works great for Roku - no more ads anywhere!
greggman3over 3 years ago
I&#x27;ve wondered if twitter and similar sites (google news?) are not running afoul of any accessibility laws. I&#x27;ve wanted to apply ublock origin rules but twitter does not have any aria tags and all the CSS rules are auto-generated and compressed (obfuscated?) so it&#x27;s hard to make any rules that don&#x27;t rely on content
评论 #30070564 未加载
caaqilover 3 years ago
This is awesome. I think it&#x27;d be useful to add filters for blocking sites that just copy SO and similar websites.
评论 #30058768 未加载
评论 #30062929 未加载
stevedzreamsover 3 years ago
I didn&#x27;t realise uBlock Origin was so powerful, can hide authors from websites that you don&#x27;t enjoy.<p>theguardian.com##.fc-item__byline:has-text(Zoe Williams):upward(.fc-slice__item)
评论 #30069850 未加载
contravariantover 3 years ago
If you&#x27;re going to bother with accounts it&#x27;s a bit annoying that you can&#x27;t just contribute directly from your account. Having to create a pull request is slightly annoying.<p>And at this point my personal list of uBlock rules is tailored to satisfy some <i>very</i> specific personal needs which I&#x27;d feel a bit apprehensive about just sharing without some degree of anonymity. Heck there are rules that would allow you to identify my account on other social media.<p>Also if this is to get as popular as userscripts&#x2F;styles are&#x2F;were then some way of finding rules per webpage would be nice.
评论 #30064865 未加载
happybuyover 3 years ago
This is a great idea and is something similar to what I was thinking of implementing in the ad blocker that I develop.<p>Some suggested improvements would be to actually use domain names (&#x27;*.google.com&#x27;) as the way to classify filters instead of just tags (&#x27;google&#x27;). This would make it possible to integrate with an ad blocker that automatically suggest filters to enable when you are browsing a specific website.<p>E.g. when you are browsing Google you could see the list of suggested filters you could enable for that site based upon the filters from letsblock.it<p>It would also probably be necessary to add some rating or scoring of the filters in the future to sort and flag those which are most helpful vs. those which are out of date or no longer work.
danShumwayover 3 years ago
I really like the idea, I&#x27;m less enthused about the account tie-in, even though I do get why it exists. I&#x27;m not sure off the top of my head what a better solution would even be. It is good that you can still manually maintain your own filters if you want and just copy the rules in, so there&#x27;s value here even for people who don&#x27;t want to make accounts.<p>And I do really like the effort to make this kind of stuff more accessible, I think it&#x27;s understated how important it is to have a nice a site with a tutorial saying &quot;here&#x27;s how you add a filter&quot;, and that there&#x27;s a ton of value in making it easier for normal people to update that. I&#x27;m happy to see people helping to meet that need.<p>----<p>I&#x27;ll look into possibly making a pull request when I have more time, but for whatever it&#x27;s worth, here are my HN rules that hide my own karma from me without otherwise messing with any of the site&#x27;s formatting. I&#x27;ve found that making my own karma invisible helps me avoid some of HN&#x27;s more toxic qualities:<p><pre><code> news.ycombinator.com##.comhead .score:style(overflow: hidden; display: inline-block; line-height: 0.1em; width: 0; margin-left: -1.9em;) news.ycombinator.com##.comhead:not(.sitebit):style(overflow:hidden; display: inline-block); news.ycombinator.com###hnmain &gt; tbody &gt; tr:first-of-type table td:last-of-type .pagetop:style(font-size: 0!important; color: transparent!important;) news.ycombinator.com###hnmain &gt; tbody &gt; tr:first-of-type table td:last-of-type .pagetop &gt; *:style(font-size: 10pt; line-height: 1.45em;) news.ycombinator.com###logout::before:style(content: &quot;|&quot;; padding: 0.25em;) news.ycombinator.com##form.profileform tbody tr:nth-child(3) </code></pre> HN is pretty annoying to customize because the generated HTML is so bad, but the site is also really static, so filters almost never need to be updated. I&#x27;ve got a couple more janky ones that I use for blocklisting certain users or filtering articles, but they&#x27;re not really reliable or consistent enough for me to share imo.<p>Caveats: I haven&#x27;t tested these on mobile because I tend to avoid HN on mobile anyway, but I probably should test them sometime to make sure they don&#x27;t break anything there. Also, some of these rules won&#x27;t completely hide the elements from screen readers. It won&#x27;t break anything, it just won&#x27;t get rid of every reference to your karma. Unfortunately because of how HN&#x27;s HTML is set up, it&#x27;s kind of tricky to do better, but maybe I can try to think of something later that works better.
评论 #30060608 未加载
Daneel_over 3 years ago
I&#x27;d love a way to suggest ideas. For example, the &#x27;clean up google search result&#x27; filters don&#x27;t include &quot;People also search for&quot;, which can be removed with: google.*##[id^=&quot;eob_&quot;]
评论 #30098270 未加载
wanderer_over 3 years ago
Here&#x27;s the ever-present warning when employing any ad-blocking: make sure you whitelist friendly blog sites, they need your ad money to operate! (Not that there is anything wrong with this project, just keep that in mind).<p>I do understand that this is something completely different, and it solves a real problem. Great job! Welcome back to the game, xvello, 2005 was a long time ago...<p>I might pop into the repo later and see about contributing.
评论 #30065070 未加载
评论 #30065405 未加载
评论 #30064831 未加载
jaredltover 3 years ago
It would be great to see screenshots of what each option will block. Although many are obvious, some are less clear.
评论 #30064962 未加载
only4hereover 3 years ago
This is a great idea, I like that you can generate lists for DuckDuckGo as well. It&#x27;d be cool to also see lists for SearX, too. I see a lot of these list websites online but this one allows for more specific use cases rather than the &quot;block everything&quot; ones that I usually find.
评论 #30057654 未加载
captn3m0over 3 years ago
I do some custom filters for blocking useless elements on websites (paywall popups, long-footers, useless notifications, copyright statements etc, useless images on news websites) mainly using the uBlock picker. Here&#x27;s some of them: <a href="https:&#x2F;&#x2F;www.toptal.com&#x2F;developers&#x2F;hastebin&#x2F;goconuxufi.pl" rel="nofollow">https:&#x2F;&#x2F;www.toptal.com&#x2F;developers&#x2F;hastebin&#x2F;goconuxufi.pl</a>, will try to suggest these to letsblockit later.
评论 #30059323 未加载
darepublicover 3 years ago
These days what I typically want to block are the gdpr modals that pop up that demand you read and interact with a bunch of legalese or click I surrender, own me.
评论 #30059179 未加载
评论 #30059982 未加载
评论 #30058971 未加载
评论 #30059114 未加载
评论 #30065248 未加载
jiriroover 3 years ago
Is there a way to use uBlock Origin in Safari on iPhone&#x2F;Mac?
评论 #30063633 未加载
cuham_1754over 3 years ago
Thank you so much for your work, a very easy to use interface! Hopefully you will add Facebook or Twitter post blocking in future updates!
djanogoover 3 years ago
Why not use Firefox builtin uBlock cloud sync and just copy paste filters from this site?, instead of creating account for this website.
评论 #30064899 未加载
klntskyover 3 years ago
Cool. However, contributions via PRs are a bit more complicated than it needs to be.
pigcatover 3 years ago
Nicely done - thanks!
cecilplover 3 years ago
uBlock is starting to become a one-stop shop unicorn!
BoppreHover 3 years ago
Offtopic: are &quot;Show HN&quot; topics with <i>both</i> link and text a new feature? The Submit page still says &quot;If there is no url, the text (if any) will appear at the top of the thread.&quot;.<p>If it&#x27;s a new feature, I find it extremely useful.
评论 #30060289 未加载
评论 #30060266 未加载