3 ms·
Oh wow, so that's basically a way of getting around the fact that JavaScript doesn't have built-in zip/gz/deflate support, but browsers do have built-in PNG sup
by crazygringo 3y ago
Oh wow, so that's basically a way of getting around the fact that JavaScript doesn't have built-in zip/gz/deflate support, but browsers do have built-in PNG support? Clever.
- oritsnile 3y agoThere is the Compression Streams API which hast gzip and deflate support, but it pretty new. Firefox supports it since halfe a year. https://developer.mozilla.org/en-US/docs/Web/API/Compression_Streams_API https://developer.mozilla.org/en-US/docs/Web/API/Compression...
- lifthrasiir 3y agoUnfortunately it still doesn't expose Brotli [1], which should be already in web browsers due to `Content-Encoding: br`. There is a very roundabout way to decompress a Brotli stream though, and that's how I've got a typing game into 1 KB of JavaScript [2] back in 2022. [1] https://github.com/WICG/compression/issues/34 https://github.com/WICG/compression/issues/34 [2] https://js1024.fun/demos/2022/18/readme https://js1024.fun/demos/2022/18/readme