Closed mattgodbolt closed 2 years ago
For a quick workaround, just add this bookmarklet to your collection:
javascript:jQuery(%22%23file_upload%22).change(function(e){var%20file=e.target.files[0],fileName=file.name,fileReader=new%20FileReader;fileReader.onload=function(){miracle_reset(),loadRom(fileName,fileReader.result),hideRomChooser(),start()},fileReader.readAsBinaryString(file)});
This will enable you to select, load and run ROMs on your hardrive using the HTML5 FileReader-API in supporting browsers,
The code above in a more readable form:
$('#file_upload').change(function (e) {
var file = e.target.files[0],
fileName = file.name,
fileReader = new FileReader();
fileReader.onload = function() {
miracle_reset();
loadRom(fileName, fileReader.result);
hideRomChooser();
start();
};
fileReader.readAsBinaryString(file);
});
Thanks! I should really fix the underlying issue (I'd be happy to accept a pull request too) :)
On Thu, Aug 20, 2015 at 1:31 AM, Gernot Kieseritzky < notifications@github.com> wrote:
The code above in a more readable form:
$('#file_upload').change(function (e) { var file = e.target.files[0], fileName = file.name, fileReader = new FileReader();
fileReader.onload = function() { miracle_reset(); loadRom(fileName, fileReader.result); hideRomChooser(); start(); };
fileReader.readAsBinaryString(file); });
— Reply to this email directly or view it on GitHub https://github.com/mattgodbolt/Miracle/issues/5#issuecomment-132906151.
Matt
the file browser is basically completely broken