I get what you're trying to get at here - but counterpoint: a lot of sites offer very long or infinitely scrolling pages. Getting rid of stuff you've scrolled past or wont scroll to for a while makes the page not a memory leak. So specifically for Discourse, New Reddit, Discord, Facebook, Twitter, Bluesky, and all those family of pages, if you do manage to succeed you will turn the page into a memory leak. And it's going to lag your renderer if those objects aren't unloaded.
this post was submitted on 16 Dec 2024
7 points (73.3% liked)
Firefox
4215 readers
21 users here now
A community for discussion about Mozilla Firefox.
founded 2 years ago
MODERATORS
I doubt it. The elements being added/removed is handled by JS, not your browser, so your browser can't influence the behavior of that.
You might be able to write some JS that searches the data in memory directly, rather than searching the visual representation that your browser displays.