Posted on: 03/18/18 04:57AM
I decided to go ahead and implement this myself as client side code.
My solution looks like this when installed:
imgur.com/a/jl9eGWhen the page loads, it now has a text input where users enter the tags they want to filter to separated by a space, exactly how they search for posts already. After 500ms have passed since the last key press, the filter runs. All posts are revealed and then the posts that do not match are hidden. As each filter runs, the DOM elements are iterated over from a cache variable, so the DOM doesn't need to be scanned for each filter, only once as the page loads. This should remain fast even as lots of favorites are added.
JavaScript (ES3):
gist.github.com/anonymous/ce6e11f6be5056f23e006ec48c926207And because it was coded in TypeScript, here's the source code:
gist.github.com/anonymous/e7f66ebdcb88a07d82f5f849d87266beNote that the only dev dependency for the source code is "typescript": "^2.7.2".
To install, ensure that the server sends this JavaScript to the page (or a script tag directing the browser to load the code from a dedicated URL), *after* all favorites have been rendered to the page. Right before the </body> tag is ideal for this.
The code is in an IIFE so it will not interfere with existing client side code for the page.
_________________________________________
For those eager to use this before the site admin implements it, you can copy and paste the contents of the compiled code into your console in your browser's dev tools and hit enter. You'll see the filter input added to the page and the filtering will work. Note that closing the page will cause this to be deactivated until you repeat these steps again.