How to block posts about Elon Musk (or other custom string) on computer - eviltoast

Using uBlock Origin, you can add your own filter. This filter will block any post with the text “Elon Musk” (not case sensitive), modify as needed.

lemmy.world##div.post-listing:has(span:has-text("/elon musk/i"))

div.post-listing is the element to block
:has(args) returns elements where args evaluate to true
span is the element with the title text
:has-text(needle) returns the element if it has the next needle, supports regex with \needle\ and remove case sensitivity with i

Read more here: https://github.com/gorhill/uBlock/wiki/Procedural-cosmetic-filters

  • TDCN@feddit.dk
    link
    fedilink
    English
    arrow-up
    3
    ·
    1 year ago

    It’s sadly not perfect as @Mananasi@feddit.nl also states, and since I like maths related stuff too and science it’ll likely filter out too much stuff. But I appreciate your efforts. An ai algorithm or a community created blacklist is probably the only solution.

    • madsen@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      Yeah, good points. I did note, though, that it probably wasn’t perfect. I kinda figured it would probably catch other stuff too but I couldn’t think of anything specific at the time.