My web application lets the users "save" a file by downloading it as described below (Source).
However browsers like Firefox in its default setting then tries to open the file and says "Opening filename.json" and not "Saving File". While I understand the reason for this is that the browser tries to immediately open a downloaded file if configured as such, this confuses my users because there are now three different words ("download", "save", "open") for the same operation and they don't know if they chose the wrong one. There is also a load option where users can upload their saved data to load it in the application, adding to the confusion.
Is there any way to tell the browser to stop trying to open the file (which it cannot do anyways, it is a custom format for that web application), or is there any other way to provide more clarity to the users?
export function saveJson(data,fileName)
{
if(a===null)
{
a = document.createElement("a");
document.body.appendChild(a);
a.style = "display: none";
}
const json = JSON.stringify(data);
const blob = new Blob([json], {type: "application/json"});
const url = window.URL.createObjectURL(blob);
a.href = url;
a.download = fileName;
a.click();
window.URL.revokeObjectURL(url);
log.debug("JSON File saved: "+fileName);
}