i was trying to implement blurhash display, i tried relying on on:load to turn off the blurhash when the image is loaded, but i discovered a "fun" race condition where if the image loads before the javascript initializes then the on:load handler is never executed so it gets stuck showing the blurhash...
Conversation
Notices
-
Embed this notice
Delta (delta@mk.absturztau.be)'s status on Saturday, 25-May-2024 10:56:49 JST Delta
-
Embed this notice
iced depresso (icedquinn@blob.cat)'s status on Saturday, 25-May-2024 10:56:47 JST iced depresso
@delta :thinking_cirno: if the script is up at the top of the file, it should get loaded before anything else? -
Embed this notice
iced depresso (icedquinn@blob.cat)'s status on Saturday, 25-May-2024 10:57:17 JST iced depresso
@delta i guess that doesn't work if cache shenanigans occur though. rip -
Embed this notice
Delta (delta@mk.absturztau.be)'s status on Saturday, 25-May-2024 11:03:05 JST Delta
@icedquinn@blob.cat (idk why that was boosted i already found a solution) but yeah, when an image was cached it'd load before the JS, but there is (thankfully) a property that allows you to check if an image has loaded from JS that i could check before showing the blurhash
iced depresso likes this.
-
Embed this notice