ATRIUMsearch → argument graph
MechanismArticle

fetch() 可以直接对 data: URI 发起调用,并将响应体通过 DecompressionStream 管道处理,在浏览器中解码 deflate-raw 压缩数据。

这段代码片段揭示了 fetch() 可以用于 data: URI,其响应体可以通过 DecompressionStream('deflate-raw') 进行管道处理,即时将内嵌的 base64 地图数据解压为 HTML。 ✦ AI 生成 · 平台预翻

Simon Willison · Simon Willison's Weblog · 2026-07-04 · English original →

我之前不知道 fetch() 还能像这样用在 data: URI 上:fetch('data:;base64,1ZpLsgIxCEXnrM...==').then( r => r.body.pipeThrough(new DecompressionStream('deflate-raw')) ).then( s => new Response(s).text() ).then( t => b.innerHTML = '<pre style=font-size:.65vw>' + t )
I didn't know you could use fetch() with data: URIs like this: fetch('data:;base64,1ZpLsgIxCEXnrM...==').then( r => r.body.pipeThrough(new DecompressionStream('deflate-raw')) ).then( s => new Response(s).text() ).then( t => b.innerHTML = '<pre style=font-size:.65vw>' + t )

阅读原文 ↗合理引用摘录 · 中文为平台译文