machawk1 / warcreate

Chrome extension to "Create WARC files from any webpage"
https://warcreate.com
MIT License
205 stars 13 forks source link

Migrate to using StreamSaver from FileSaver #105

Open machawk1 opened 6 years ago

machawk1 commented 6 years ago

There seems to be quite a few advantages (e.g., higher file size limit) but support is limited to Chrome and Opera at the moment, which is not an issue.

https://github.com/jimmywarting/StreamSaver.js

machawk1 commented 6 years ago

I poked around the module in the issue-105 branch. Even with the example code in-place, no file appears to be written from the extension context. Perhaps there is an issue with ServiceWorker support as initiated from extensions.

N0taN3rd commented 6 years ago

@machawk1 You mighy have better luck using https://github.com/feross/buffer

It's nodes buffer module but for the browser.

I found it useful for stuffing content into blobs.

machawk1 commented 6 years ago

@N0taN3rd Thanks for the recommendation. Getting the data in Blob form is not an issue -- that's working fine for FileSaver.

I was opting for StreamSaver due to its ability to write larger files to disk (outside of the sandbox) compared to FileSaver and not necessarily its streaming capability.

I do not see anything in @feross's buffer package that would allow this but perhaps it is capable but wrapped up in the abstraction. Can you provide more insight on this?