You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Extract files with StreamReader (a TransformStream)
212
-
response.body
213
-
.pipeThrough(newStreamReader())
214
-
.pipeTo(
215
-
newWritableStream({
216
-
// The StreamReader emits each file's name and a stream containing its contents
217
-
asyncwrite({ name, stream }) {
218
-
console.log(`Extracting: ${name}`);
219
-
220
-
// Save each extracted file, also with streams
221
-
constfileStream=stream();
222
-
await fileStream
223
-
.pipeTo(
224
-
streamSaver.createWriteStream(name)
225
-
);
226
-
},
227
-
}),
228
-
);
229
-
```
230
-
231
-
## Supporting Firefox
179
+
## Supporting Legacy Browsers
232
180
233
-
Firefox [does not support ReadableStream#pipeThrough](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream#browser_compatibility), since it does not have `WritableStream` or `TransformStream` support yet. Conflux ponyfills `TransformStream` out of the box in Firefox, but if you're using the `myReadable.pipeThrough` and plan to support Firefox, you'll want to ponyfill `ReadableStream` like so:
181
+
Conflux is compatible with all modern browsers since June 2022.
-[`TransformStream`](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream), and [`WritableStream`](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream) (available in browsers since June 2022) by adding [web-streams-polyfill](https://www.npmjs.com/package/web-streams-polyfill).
186
+
-[`BigInt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) (available in browsers since January 2020) by setting `globalThis.JSBI` equal to [JSBI](https://github.com/GoogleChromeLabs/jsbi) before importing Conflux.
187
+
-[`globalThis`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis) (available in browsers since January 2020) by adding a polyfill like this [globalthis](https://www.npmjs.com/package/globalthis) or manually setting a shim.
0 commit comments