From 8af8173759417721914621c763d4ba110b17a453 Mon Sep 17 00:00:00 2001 From: Honoka55 <1915637207@qq.com> Date: Wed, 28 Feb 2024 12:56:04 +0800 Subject: [PATCH] fix: add timeout before download --- script.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/script.js b/script.js index cd4c76e..2b975c6 100644 --- a/script.js +++ b/script.js @@ -258,8 +258,10 @@ window.onload = () => { const url = URL.createObjectURL(blob); a.href = url; a.download = 'logo.png'; - a.click(); - URL.revokeObjectURL(url); + setTimeout(() => { + a.click(); + URL.revokeObjectURL(url); + }, 100); }); ctx.clearRect(canvas.width - 210, 0, canvas.width, 20);