Comment on Do posts from instances that don't allow downvotes have an unfair advantage?

<- View Parent
Anafroj@sh.itjust.works ⁨10⁩ ⁨months⁩ ago

Thanks, that’s a good idea.

The reason why it only works on page reload is because Lemmy is a SPA : it makes it look like you’re browsing several pages, but it’s actually always the same, and it uses javascript to change the url and load new content. So the “load” event, triggered when the current page is done loading, is only triggered once because the page is only changed once. If you wonder why : SPA became commonplace in the 2010s because javascript applications started to get way bigger than previously, and it was helping with page load speed. For a time… because when you make page load faster, people just make it load more things until it’s slow again. :)

My first reaction was that additionally to binding to the load event, we probably just can bind to the popstate event, which happens when the url is programmatically changed. But my first tests were not successful in doing that. I’ll have a quick look at the source code of Lemmy in the morning to see if I can solve this.

source
Sort:hotnewtop