From a7bfe5736317c01d2fffe2050653f9ee2ceda7ac Mon Sep 17 00:00:00 2001 From: multipleof4 Date: Fri, 12 Sep 2025 10:42:45 -0700 Subject: [PATCH] feat: update index.html --- index.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 9945064..91d4877 100644 --- a/index.html +++ b/index.html @@ -110,8 +110,9 @@ .then(res => res.ok ? res.json() : Promise.reject(new Error(`Server responded ${res.status}`))) .then(data => (status.textContent = 'Downloading file...', fetch(data.current_version.file.url).then(res => res.ok ? res.blob() : Promise.reject(new Error(`File download failed: ${res.status}`))).then(blob => ({blob, url: data.current_version.file.url})))) .then(({blob, url}) => { - const a = document.createElement('a'), fileName = url.split('/').pop().replace(/\.xpi$/, '.zip'); - a.href = URL.createObjectURL(blob); + const zipBlob = new Blob([blob], { type: 'application/zip' }), fileName = url.split('/').pop().replace(/\.xpi$/, '.zip'); + const a = document.createElement('a'); + a.href = URL.createObjectURL(zipBlob); a.download = fileName; document.body.appendChild(a).click(); URL.revokeObjectURL(a.href);