html5 download blob
https://stackoverflow.com/questions/19327749/javascript-blob-filename-without-link
https://codepen.io/vidhill/pen/bNPEmX
html 5 Simple File Blob Download
demo
// <a id="myButton" href="#">Download JSON</button>
// <button id="btn">Download JSON</button>
// dummy json data to save
const data = {
x: 42,
s: "hello, world",
d: new Date()
};
let btn = document.getElementById("btn");
btn.addEventListener(`click`, (e) => {
let json = JSON.stringify(data),
// Blob
blob = new Blob([json], {type: "octet/stream"}),
// blob to url
url = window.URL.createObjectURL(blob);
this.href = url;
this.download = "api.json";
this.target = "_blank";
// target filename
});