style backup: +revokeObjectURL +MIME-type
This commit is contained in:
parent
1651d52776
commit
a2faa9398a
|
@ -252,10 +252,13 @@ $('#file-all-styles').onclick = () => {
|
||||||
fetch(url)
|
fetch(url)
|
||||||
.then(res => res.blob())
|
.then(res => res.blob())
|
||||||
.then(blob => {
|
.then(blob => {
|
||||||
const a = document.createElement('a');
|
const objectURL = URL.createObjectURL(blob);
|
||||||
a.setAttribute('download', fileName);
|
Object.assign(document.createElement('a'), {
|
||||||
a.setAttribute('href', URL.createObjectURL(blob));
|
download: fileName,
|
||||||
a.dispatchEvent(new MouseEvent('click'));
|
href: objectURL,
|
||||||
|
type: 'application/json',
|
||||||
|
}).dispatchEvent(new MouseEvent('click'));
|
||||||
|
setTimeout(() => URL.revokeObjectURL(objectURL));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user