| 264 | } |
| 265 | |
| 266 | async function compressDataGzip(data) { |
| 267 | if (typeof CompressionStream !== 'undefined') { |
| 268 | let blob = new Blob([data]) |
| 269 | const stream = blob.stream().pipeThrough(new CompressionStream("deflate")); |
| 270 | let response = await new Response (stream).arrayBuffer().catch(e => {console.error("CompressionStream error", e)}) |
| 271 | if (response) return response |
| 272 | } |
| 273 | |
| 274 | return import("/js/gzip/pako.min.js").then((module) => { |
| 275 | return pako.deflate(data, {level:"9"}); |
| 276 | }); |
| 277 | } |
| 278 | |
| 279 | async function decompressData(data, encoding, callback) { |
| 280 | if (encoding == GZIP_MARKER) { |