espruino / EspruinoTools

JavaScript library of tools for Espruino - used for the Web IDE, CLI, etc.
Apache License 2.0
150 stars 89 forks source link

Make fileSaveDialog work in non-Chrome browsers #129

Closed Franzo- closed 4 years ago

Franzo- commented 4 years ago

Clicking the "Save File" button of the EspruinoWebIDE in non-Chome browsers (i.e. Firefox) fails with the following error printed on console:

Uncaught ReferenceError: chrome is not defined
    fileSaveDialog debugger eval code:5
    click https://www.espruino.com/ide/js/core/file.js:57

Browsers like Firefox do not have the 'chrome' symbol defined, so check it in fileSaveDialog() function before accessing 'chrome.filesystem'.

gfwilliams commented 4 years ago

Thanks! That was a stupid mistake on my part ;)