mirror of
https://github.com/documize/community.git
synced 2025-07-24 15:49:44 +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) {
|
||||
let b = new Blob([content], { type: 'text/html' });
|
||||
|
||||
let a = document.createElement("a");
|
||||
a.style = "display: none";
|
||||
document.body.appendChild(a);
|
||||
if (window.navigator && window.navigator.msSaveOrOpenBlob) {
|
||||
window.navigator.msSaveOrOpenBlob(b, filename);
|
||||
} 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;
|
||||
a.download = filename;
|
||||
a.click();
|
||||
|
||||
window.URL.revokeObjectURL(url);
|
||||
document.body.removeChild(a);
|
||||
window.URL.revokeObjectURL(url);
|
||||
document.body.removeChild(a);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue