jimmywarting / StreamSaver.js

StreamSaver writes stream to the filesystem directly asynchronous
https://jimmywarting.github.io/StreamSaver.js/example.html
MIT License
4.04k stars 418 forks source link

[New API] Stream are going to be transferable eventually #74

Closed jimmywarting closed 5 years ago

jimmywarting commented 5 years ago

...That means no more annoying postMessage back and forth. instead of passing a messageChannel port to the service worker we can send a stream directly to the sw.js

// then we can replace this line
iframe.contentWindow.postMessage({filename, size}, '*', [channel.port2])

// with something along this:
iframe.contentWindow.postMessage({filename, size}, '*', [readableStream]) 
// and simply just pass that further down to the respondWith (that will be a direct data binding/flow)
frank-dspeed commented 5 years ago

it should be a additional option as not all browsers are supporting service workers