Closed notEvil closed 3 years ago
Thanks for this! So you're saying specifically to change this line? https://github.com/espruino/EspruinoTools/blob/master/core/utils.js#L592
I guess probably pull the common Blob code right to the top of the function?
Yes, I reproduced the issue with var st=require('Storage');st.erase('t');st.write('t','\1A\x9D\xC2\xC2\x88\xCB\0F\0');
(source 10bytes, downloaded 15bytes). And it only appears in the Chrome app, not in Chrome web.
I'm not familiar with js enough to suggest a more lightweight fix than this.
Thanks! Just added a fix
Hi,
when I download a binary file in the Chrome web IDE, the target files content doesn't match the source. When I view the source file in the IDE it shows correctly. So I tracked down the issue and found that when
fileSaveDialog
putsdata
into aBlob
, it gets reinterpreted (a 10 character string suddenly had Blob length 17). When I changed the part to behave like the non-Chrome part withit worked.