Board Thread:The Last Sovereign Discussion/@comment-29984007-20180410151643/@comment-31763506-20180709152613

AFU 79.121.42.59 wrote: not to be a killjoy, but i already save my variants with right click->save page as. other than saving it into a folder so al the tidbits dont get mixed, it seems to be working fine (with firefox anyway, not sure taht matters)

Yes it does matter. I've tested your method in Firefox and Chrome, and it doesn't work with Chrome.

Arakhne wrote: Also, StackOverflow offers some workaround, as usual: https://stackoverflow.com/questions/13405129/javascript-create-and-save-file

Basically, it creates a temporary url with a temporary file made of the data of your choice, then the user can use the standard download function of any browser.

I've tested the code you linked to under Chrome, IE 11 and Edge, and it's my opinion that it isn't a viable solution. With Chrome, it saves the output blob to the downloads folder with a fixed and unchangeable filename, "[object HTMLInputElement].txt". Edge has the same behavior. IE 11 disables the execution of the IE 10 specific invocation of the ActiveX Object used to save it to a specific location by default, and this seems to count as a javascript compilation error when the page is rendered.

Moreover, the input type file always defaults to the user documents folder.

So using the combination of these features, you get save button that downloads the blob with your saved state information to "[object HTMLInputElement].txt" in the downloads folder, and the user has to copy this file to wherever he wants to keep the saves and rename it uniquely. You put it in your documents folder if you want the next part to be easy. Then you have a load button which opens a windows interface allowing you to select the file you want to load, and you have to either use the documents folder for all your saves or go to the trouble of navigating through the filesystem in the dialog to the location where you're keeping the damned things.

Now, compare the amount of work that entails for the user to AFU's system:

1) Download and Install Firefox if necessary. 2) Open the Calculator in Firefox. 3) Make your scenario and then save the Calculator by right clicking and using "save page as" in Firefox with a specified file name.

The js interface loses by any sane measure of usability, plus it requires work to implement.

It isn't a job that's worth doing, so I have no intention of continuing with it.

If someone else wants to dick around with the code I've put in to this point:

http://s000.tinyupload.com/index.php?file_id=00098663048845354942

@XOyOyOx:

Let's say that you're right and the links you've posted are an approach that will actually work. Will it function significantly better than just using Firefox's Save As? If it will, how much time will go into coding and testing it?

Admitting that we have a viable approach with the web storage API and the FileReader is premature though. Are these solutions going to work irrespective of browser? Will there be requirements on the user to get the thing working correctly like the issues I outlined above with the BLOB download system? Will the web storage API have enough file space to store all of the myriad variables in the Calculator? (For that matter, will the BLOB data?) Are we sure there are no hidden pitfalls that will make the solution unworkable? What if the code functions but some browsers disable it automatically for security, for example?