mirror of
https://github.com/documize/community.git
synced 2025-07-25 16:19:46 +02:00
Fix issue with MS Edge not downloading export HTML file
This commit is contained in:
parent
e737339090
commit
e8735ffc12
1 changed files with 13 additions and 10 deletions
|
@ -55,17 +55,20 @@ export default Service.extend({
|
||||||
downloadFile(content, filename) {
|
downloadFile(content, filename) {
|
||||||
let b = new Blob([content], { type: 'text/html' });
|
let b = new Blob([content], { type: 'text/html' });
|
||||||
|
|
||||||
let a = document.createElement("a");
|
if (window.navigator && window.navigator.msSaveOrOpenBlob) {
|
||||||
a.style = "display: none";
|
window.navigator.msSaveOrOpenBlob(b, filename);
|
||||||
document.body.appendChild(a);
|
} else {
|
||||||
|
let a = document.createElement("a");
|
||||||
|
a.style = "display: none;";
|
||||||
|
document.body.appendChild(a);
|
||||||
|
|
||||||
let url = window.URL.createObjectURL(b);
|
let url = window.URL.createObjectURL(b);
|
||||||
|
a.href = url;
|
||||||
|
a.download = filename;
|
||||||
|
a.click();
|
||||||
|
|
||||||
a.href = url;
|
window.URL.revokeObjectURL(url);
|
||||||
a.download = filename;
|
document.body.removeChild(a);
|
||||||
a.click();
|
}
|
||||||
|
|
||||||
window.URL.revokeObjectURL(url);
|
|
||||||
document.body.removeChild(a);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue