feat: update index.html

This commit is contained in:
2025-09-12 10:42:45 -07:00
parent ee905ee7e7
commit a7bfe57363

View File

@@ -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);