Thanks, this is the best implementation idea for this I've seen yet imo, will definitely be using this from now on.
I haven't found any bugs yet, but I'd like to request two future improvements:
- Changing the order of magazines and collections
Details
I have like three collections and a ton of magazines, so having to scroll through all the magazines to reach the collections is a bit of a pain. It's still much easier than before this script, but it would be even better if I could move the collections above the magazines.
On the other hand, someone else might have the opposite situation and would prefer it the way it currently is, so unlike the other user I'm not asking you to just swap the order.
I think the ideal solution would be adding a setting somewhere to determine which comes first. So every user can tailor the functionality to their needs.
- Support for turbo mode
Details
Ernest added turbo as an optional mode in the past months (you can find it in the sidebar options). It turns the site into a single page experience, which means kbin.social links don't open the website anew entirely but rather replace the page content, including the changes your script makes. This cuts down on loading time, but it also causes scripts to break.
It would be great if the script were to support turbo mode eventually, especially if Ernest makes it the standard in the future (it is marked as experimental currently, so that's probably the eventual intention).
To do so, you'd have to attach a MutationListener
to the body
element like I did here. But that will run many times more than just on navigation, so you'd also have to ensure your code does support being run multiple times without breaking.