From 79d313362894fe9a978bac53b2d86fafa86a2b09 Mon Sep 17 00:00:00 2001 From: dan Date: Mon, 19 Jun 2023 15:46:23 -0400 Subject: fix: large photo albums do not fail to download --- demo.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'demo.js') 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); } -- cgit v1.2.3