Under the hood, uBlock works by filtering DOM elements. The "ad blocking" part of it is the set of curated filter lists built on top of that. But it also allows you to right-click on any element and create a custom filter, or write your own using DOM queries.

This is what I use to block the news feed on FB to prevent doomscrolling.