|
|
@@ -31,12 +31,11 @@
|
|
|
removeEventListener("message", listener, false);
|
|
|
const [filename, content] = JSON.parse(event.data);
|
|
|
const link = document.createElement("a");
|
|
|
- document.body.appendChild(link);
|
|
|
link.download = filename;
|
|
|
- const url = URL.createObjectURL(new Blob([content], { type: "text/html" }));
|
|
|
- link.href = url;
|
|
|
+ link.href = URL.createObjectURL(new Blob([content], { type: "text/html" }));
|
|
|
+ document.body.appendChild(link);
|
|
|
link.dispatchEvent(new MouseEvent("click"));
|
|
|
- URL.revokeObjectURL(url);
|
|
|
+ URL.revokeObjectURL(link.href);
|
|
|
}
|
|
|
|
|
|
})();
|