Open Nightfirecat opened 8 years ago
I believe that's an artifact of the old proprietary methods used by jQuery, and security implementations by browsers. (because at that point, there was no collective effort to develop the JS API to access filesystems in a secure way)
I like the idea of moving away fro a JS file, but doing so and breaking the experience for users who currently use the JS files may not be ideal. Should file writing also be available, maybe a conversion script should be run/included with this change.
Update: looks like every major browser supports the FileReader API, which would do the job. http://caniuse.com/#search=FileReader%20API
I may do some work on this in the near future; would love to kill the fancy quotes problem.
Well damn, looks like that only works if you select a local accounts file with <input type="file">
. Not really feasible when you'd rather have the accounts loaded on page load with no input.
Javascript is more often than not able to read local files from a user's filesystem. (ref: http://stackoverflow.com/questions/14446447/javascript-read-local-text-file) Using a method like this, we should validate the file and try to provide useful error messages if something looks wrong. (illegal characters, invalid formatting, etc.)