fixed link generation

This commit is contained in:
dcore94 2023-02-09 12:50:12 +01:00
parent fe30758a93
commit 1cd4196765
1 changed files with 2 additions and 2 deletions

View File

@ -306,10 +306,10 @@ class CCPMethodEditorController extends HTMLElement{
} }
).then(data=>{ ).then(data=>{
const filename = data.title + "-" + data.version + ".json" const filename = data.title + "-" + data.version + ".json"
const objectURL = URL.createObjectURL(data) const datastr = "data:text/json;charset=utf-8," + encodeURIComponent(JSON.stringify(data));
var tmplnk = document.createElement("a") var tmplnk = document.createElement("a")
tmplnk.download = filename tmplnk.download = filename
tmplnk.href = objectURL tmplnk.href = datastr
document.body.appendChild(tmplnk) document.body.appendChild(tmplnk)
tmplnk.click() tmplnk.click()
document.body.removeChild(tmplnk) document.body.removeChild(tmplnk)