summaryrefslogtreecommitdiffstats
path: root/demo.js
diff options
context:
space:
mode:
Diffstat (limited to 'demo.js')
-rw-r--r--demo.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/demo.js b/demo.js
index 9d76d48..9b843cc 100644
--- a/demo.js
+++ b/demo.js
@@ -37,10 +37,8 @@ function download() {
const link = document.createElement('a');
const mimeType = 'text/plain';
link.download = `${(new Date()).toISOString()}-photobook.html`;
- link.href = 'data:'
- + mimeType
- + ';charset=utf-8,'
- + encodeURIComponent(htmlOuter(elHtml));
+ const blob = new Blob([htmlOuter(elHtml)], {type: mimeType});
+ link.href = URL.createObjectURL(blob);
link.click();
// URL.revokeObjectURL(link.href);
}