2 ms·
uBlock Origin on Firefox is great. I'm sure there are other content blockers that allow custom filters, but you can create and modify them as you see fit. Here
by jjice 2y ago
uBlock Origin on Firefox is great. I'm sure there are other content blockers that allow custom filters, but you can create and modify them as you see fit. Here are some that I have:
# Block suggested posts on LinkedIn (more so because these are annoying) - this is very loose and can be improved. It break's my profile view, so I disable the extension when I'm there
linkedin.com##:xpath(//span[text()[contains(.,'Suggested')]]/../../../../../../../../../../..)
# Block political related posts on HN. This leaves the comment section still since that's just another <tr>.
# HN then has two more <tr>s afterwards - one for the comment link and one for spacing
! Feb 19, 2025 https://news.ycombinator.com
news.ycombinator.com##.submission:has-text(/term1|term2/)
news.ycombinator.com##.submission:has-text(/term1|term2/) + tr
news.ycombinator.com##.submission:has-text(/term1|term2/) + tr + tr
Using the has-text with a regex will likely be key to building a lot of these. I just started yesterday with the HN one and I'm going to probably have some fun doing it for other sites soon - not just for politics, but for all sorts of bloat on other sites (HN is already good about this).
I found the LinkedIn one one Reddit. There seems to be a decent bit of filtering resources out there.
- cedws 2y agoThank you, how does the HN political filter work?
- jjice 2y agoI have political terms, but removed them for the sake of example. Between the slashes is a regular expressions, so if you just want to mute specific words, you'd separate them with a pipe (regex alternation). So you'd swap `/term1|term2/` with `/Democrat|Republican|yada yada/` and any time one of those terms appears in an HN post, it just removed it from view. Any regex (PCRE, I believe) should work there, if you want to get fancy.
- cedws 2y agoJust tried it, works great, thanks.