[HN Gopher] Show HN: Let's Block It - Custom uBlock Origin Filte...
       ___________________________________________________________________
        
       Show HN: Let's Block It - Custom uBlock Origin Filters Made Easy
        
       uBlock Origin is more than an ad-blocker, it'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.  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.  Code and content are licensed under
       the Apache 2.0 license and hosted on
       https://github.com/xvello/letsblockit. 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!
        
       Author : xvello
       Score  : 194 points
       Date   : 2022-01-24 13:41 UTC (9 hours ago)
        
 (HTM) web link (letsblock.it)
 (TXT) w3m dump (letsblock.it)
        
       | bambax wrote:
       | Personal customized filters are a great idea! Congrats!
       | 
       | Here'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's impossible to hide
       | contributions from a given user in a group; one can only leave
       | the group.
       | 
       | When using WhatsApp in the browser, a uBlock filter can hide
       | contributions from a given user like this:
       | web.whatsapp.com##div.message-in:has(div.copyable-text[data-pre-
       | plain-text*="name_of_user"])
       | 
       | This hides text messages (even successive ones where the username
       | isn't displayed) but doesn't hide messages with only images or
       | other media. For those it'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.
       | 
       | Or maybe there's a better way. Suggestions welcome.
        
         | xvello wrote:
         | That's the kind of filters I started this project for!
         | 
         | I would not accept this template in the project though, as I am
         | not willing to endorse usage of Facebook/Meta's websites. This
         | is listed in the project limitations in
         | https://letsblock.it/help/contributing
        
       | lordnacho wrote:
       | 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've
       | come across. Makes sense given their business model, I don't
       | doubt that.
        
         | andrei_says_ wrote:
         | If you inspect the markup of Facebook ads you'll see it's
         | beyond insane.
        
           | ceejayoz wrote:
           | Yeah. That little block of text that says "Sponsored" alone
           | is 4,224 characters of nonsense.
           | https://pastebin.com/DZdNkiw2
        
         | lfmunoz4 wrote:
        
         | gnud wrote:
         | This filter seems to work for me, but it'll probably break
         | soon.
         | ##:xpath(//div[@role="feed"]//div[.//a[@aria-
         | label="Sponsored"]])
        
         | dsr_ wrote:
         | FBPurity (.com) seems to spend most of its time on that case.
         | Works pretty well for months at a time, then FB changes
         | something, and a new FBP update comes through a few days later.
        
       | djanogo wrote:
       | Why not use Firefox builtin uBlock cloud sync and just copy paste
       | filters from this site?, instead of creating account for this
       | website.
        
         | xvello wrote:
         | Very good question! You are indeed free to copy the rendered
         | filters to your uBlock settings (there is even a button for
         | this). I see two reasons for using the account feature:
         | 
         | - I would never sync the same Firefox profile on my personal
         | and work laptops, with letsblock.it I can use the same custom
         | list on different Firefox profiles
         | 
         | - Rules will eventually break when websites are updated /
         | redesigned. When that happens, one contributor can PR the fix
         | for everyone, and you'll get it in the next 24h (uBlock
         | Origin's minimal filter list refresh rate)
        
       | darepublic wrote:
       | 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.
        
         | jakub_g wrote:
         | I don't use personally but this might be of interest for you:
         | 
         | https://github.com/r4vi/block-the-eu-cookie-shit-list
        
         | xvello wrote:
         | I agree that this is getting out of hand.
         | 
         | I investigated this, but as more and more websites are non-
         | functional until you chose a consent option, just hiding the
         | modal with a cosmetic filter won't help. There are several
         | browser extensions to achieve this, and I feel like this is a
         | superior solution than my project.
        
         | foxfluff wrote:
         | DNT was supposed to be a solution. Companies who insist on
         | nagging you until you "voluntarily consent" are to blame. I'm
         | not sure what killed DNT but it seems like they're trying to
         | revive it again in Europe:
         | https://news.ycombinator.com/item?id=30022523
         | 
         | No doubt companies who want to violate your privacy will lobby
         | hard against this.
        
           | Miraste wrote:
           | I remain convinced Do Not Track was a piece of sophisticated
           | satire. The notion that companies would stop ad tracking
           | because you asked them nicely is so openly ludicrous that no
           | one could have seriously expected it to work.
        
             | foxfluff wrote:
             | Then are the consent popups satire too? To me the header
             | would've just been a way to say "no consent" without
             | requiring you to play whack a mole with popups.
             | 
             | If DNT is satire and consent popups are too, are these
             | fines also a joke? https://www.enforcementtracker.com/
        
               | Nextgrid wrote:
               | They are absolutely a joke when you consider the profits
               | of the fined companies.
        
               | foxfluff wrote:
               | I don't know about that.
               | 
               | Google was fined 150 million EUR for not having a simple
               | "refuse all" button in their consent nag. A single
               | button. The complaint was that refusing is not as easy as
               | accepting all cookies.
               | 
               | 150M EUR is relatively small compared to Google's wealth,
               | but so is the infraction. And they can't just write it
               | off as a cost of doing business and continue the
               | violation, because they were given a deadline to fix it
               | and from there on a penalty of 100k EUR per day. Actually
               | I don't have the data to do the maths but I seriously
               | doubt Google's practice of making of you click a few
               | times instead of once can make them 100k EUR per day in
               | profit. And if it did, I'm sure the authorities would
               | eventually increase the fine.
               | 
               | Assuming the fine results in compliance, it really
               | doesn't look like a joke to me.
        
               | [deleted]
        
         | bspammer wrote:
         | You might be interested in the Adguard Annoyances [1][2]
         | blocklist which is easily added to uBlock Origin, just by
         | ticking a checkbox in the "Filter lists" tab of the settings.
         | 
         | [1] https://kb.adguard.com/en/general/adguard-filter-
         | policy#anno...
         | 
         | [2]
         | https://github.com/AdguardTeam/AdguardFilters/tree/master/An...
        
         | irrational wrote:
         | Seriously, I don't live in Europe, so why do I have to click
         | the cookie agreement buttons?
        
           | zeepzeep wrote:
           | So you start hating privacy laws
        
           | petercooper wrote:
           | GDPR applies to EU citizens wherever they are in the world,
           | so unless they know for sure that you're not an EU citizen,
           | they have to give you the prompt.
        
       | danShumway wrote:
       | I really like the idea, I'm less enthused about the account tie-
       | in, even though I do get why it exists. I'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's value here even for people who
       | don't want to make accounts.
       | 
       | And I do really like the effort to make this kind of stuff more
       | accessible, I think it's understated how important it is to have
       | a nice a site with a tutorial saying "here's how you add a
       | filter", and that there's a ton of value in making it easier for
       | normal people to update that. I'm happy to see people helping to
       | meet that need.
       | 
       | ----
       | 
       | I'll look into possibly making a pull request when I have more
       | time, but for whatever it's worth, here are my HN rules that hide
       | my own karma from me without otherwise messing with any of the
       | site's formatting. I've found that making my own karma invisible
       | helps me avoid some of HN's more toxic qualities:
       | 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 > tbody > tr:first-of-type table
       | td:last-of-type .pagetop:style(font-size: 0!important; color:
       | transparent!important;)       news.ycombinator.com###hnmain >
       | tbody > tr:first-of-type table td:last-of-type .pagetop >
       | *:style(font-size: 10pt; line-height: 1.45em;)
       | news.ycombinator.com###logout::before:style(content: "|";
       | padding: 0.25em;)       news.ycombinator.com##form.profileform
       | tbody tr:nth-child(3)
       | 
       | 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've got a couple more janky ones that
       | I use for blocklisting certain users or filtering articles, but
       | they're not really reliable or consistent enough for me to share
       | imo.
       | 
       | Caveats: I haven'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't break anything there. Also, some of these
       | rules won't completely hide the elements from screen readers. It
       | won't break anything, it just won't get rid of every reference to
       | your karma. Unfortunately because of how HN's HTML is set up,
       | it's kind of tricky to do better, but maybe I can try to think of
       | something later that works better.
        
         | xvello wrote:
         | Thanks for your feedback, and your filter suggestion!
         | 
         | The first iteration of this project was a CLI that took a yaml
         | file (simple map of filter name -> params) and rendered the
         | filter list to stdout. I ran that binary in a netlify pipeline
         | to publish my list for personal use. As the filter data is
         | hosted alongside the sources, it would be pretty simple to add
         | back that offline rendering capability, or run a self-hosted
         | instance.
         | 
         | As you said, I moved away from the CLI and towards a website to
         | make it more accessible for everyone. The UX is still not great
         | (especially the manual refresh via the uBlock interface), but
         | hopefully we can improve on this front with more visibility.
        
       | only4here wrote:
       | This is a great idea, I like that you can generate lists for
       | DuckDuckGo as well. It'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 "block
       | everything" ones that I usually find.
        
         | xvello wrote:
         | Thanks for the feedback! Adding another search engine to the
         | search-results filter is pretty easy. For reference, the
         | (handlebars) template for it is available at
         | https://github.com/xvello/letsblockit/blob/main/data/filters...
         | 
         | The tricky part about SearX is that it runs on several domains,
         | while uBlock Origin cosmetic filters need to be scoped to a
         | given domain name. We'd need to add a parameter to specify the
         | instance(s) on which you want the filter to be generated. If
         | you want to follow up on this, would you mind opening an issue
         | at
         | https://github.com/xvello/letsblockit/issues/new?template=up...
         | to help me with the testing?
        
       | wanderer_ wrote:
       | Here'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).
       | 
       | 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...
       | 
       | I might pop into the repo later and see about contributing.
        
         | ceejayoz wrote:
         | > Here'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).
         | 
         | I'd prefer blogs do what Serious Eats did for a while; if you
         | blocked ads, they showed a message in its place saying "we get
         | it completely, but consider donating". I'll happily donate or
         | hop on a Patreon for a site I keep coming back to if you make
         | it possible.
         | 
         | I block ads as a security measure, regardless of how much I
         | appreciate/trust a site.
        
         | halpert wrote:
         | That friendly blog site includes trackers. They won't get my
         | money until they respect my privacy.
        
       | BoppreH wrote:
       | Offtopic: are "Show HN" topics with _both_ link and text a new
       | feature? The Submit page still says  "If there is no url, the
       | text (if any) will appear at the top of the thread.".
       | 
       | If it's a new feature, I find it extremely useful.
        
         | pvg wrote:
         | https://news.ycombinator.com/item?id=30040235
        
         | [deleted]
        
       | cecilpl wrote:
       | uBlock is starting to become a one-stop shop unicorn!
        
       | jakub_g wrote:
       | 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't survive
       | gradual Firefox engine changes between v20 and v57. Anyway, good
       | old times.
        
       | jiriro wrote:
       | Is there a way to use uBlock Origin in Safari on iPhone/Mac?
        
         | dombili wrote:
         | You can't1. There is a new browser called Orion2 currently in
         | private beta that uses the same engine as Safari, which you can
         | use Firefox and Chrome extensions on. It works both on Mac, and
         | surprisingly on iOS. I believe it's the only browser on iOS
         | that allows you to use -some- desktop extensions. I use uBlock
         | Origin with it on iOS and it works good enough.
         | 
         | 1 https://github.com/el1t/uBlock-Safari/issues/158
         | 
         | 2 https://browser.kagi.com/
        
       | pigcat wrote:
       | Nicely done - thanks!
        
       | perihelions wrote:
       | It's fascinating to browse HN history and see what uBlock rules
       | HN'ers have considered worth writing comments about. The unique
       | syntax makes it very easy to find those:
       | 
       | https://hn.algolia.com/?query=%23%23%20ublock&type=comment&d...
       | 
       | ("## ublock")
        
       | caaqil wrote:
       | This is awesome. I think it'd be useful to add filters for
       | blocking sites that just copy SO and similar websites.
        
         | xvello wrote:
         | Agreed! I have lots of them in my list, using
         | https://letsblock.it/filters/search-results as a template. I'm
         | investigating adding presets to this filter (check a box to
         | block the SO / github clones, they'll be added to the filter
         | input alongside your blocked sites).
        
           | wanderingmind wrote:
           | Maybe you can fork it from the posted as the reply to the
           | parent comment.
        
           | DavideNL wrote:
           | Reminds me of https://github.com/iorate/ublacklist
           | 
           | Hopefully you will add the startpage.com search engine (has
           | same results as google) too :)
        
             | xvello wrote:
             | startpage.com (text results for now, I'll do image search
             | later) support has been added to
             | https://letsblock.it/filters/search-results ; enjoy!
        
         | wanderingmind wrote:
         | It exists, https://github.com/quenhus/uBlock-Origin-dev-filter
        
           | j1elo wrote:
           | Another one that got commented in other similar topics is
           | this one, albeit not updated since last month:
           | 
           | https://github.com/stroobants-dev/ublock-origin-shitty-
           | copie...
           | 
           | It was the same as quenhus, but with Pinterest added.
        
       | captn3m0 wrote:
       | 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's some of them:
       | https://www.toptal.com/developers/hastebin/goconuxufi.pl, will
       | try to suggest these to letsblockit later.
        
         | xvello wrote:
         | Thanks, I'll give a look at your list! I feel like the best way
         | to handle "small tweaks" would be to group them by target
         | website, and use "Cleanup Google search result pages" as an
         | example. Here's the source file for it:
         | https://github.com/xvello/letsblockit/blob/main/data/filters...
        
       | jaredlt wrote:
       | It would be great to see screenshots of what each option will
       | block. Although many are obvious, some are less clear.
        
         | xvello wrote:
         | Agreed! I decided to launch without it due to limited time, but
         | will keep that in the top priorities. Contributions are welcome
         | if some users have time to contribute screenshots!
        
       | contravariant wrote:
       | If you're going to bother with accounts it's a bit annoying that
       | you can't just contribute directly from your account. Having to
       | create a pull request is slightly annoying.
       | 
       | And at this point my personal list of uBlock rules is tailored to
       | satisfy some _very_ specific personal needs which I '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.
       | 
       | Also if this is to get as popular as userscripts/styles are/were
       | then some way of finding rules per webpage would be nice.
        
         | xvello wrote:
         | Thanks for your feedback.
         | 
         | As this is just a humble weekend project, I had to cut in scope
         | in order to move forward. This is why the project has no back-
         | office and relies on Github for content contribution. I made
         | this choice because the uBlock, EasyPrivacy and AdGuard
         | communities are using the same tool to maintain their lists. I
         | am open to changing that flow later this year, but not in the
         | immediate future.
         | 
         | I understand your privacy concerns, and invite you to read
         | https://letsblock.it/help/privacy to show that I take it
         | seriously. AFAIK, Github is pretty lenient on identity, and
         | wouldn't blink if you opened a throwaway anonymous account to
         | contribute. You can also keep custom rules in
         | https://letsblock.it/filters/custom-rules without necessarily
         | contributing them as templates.
        
       ___________________________________________________________________
       (page generated 2022-01-24 23:03 UTC)