diff --git a/index.html b/index.html index d402782..108749d 100644 --- a/index.html +++ b/index.html @@ -111,17 +111,17 @@ .then(data => { const a = document.createElement('a'); a.href = data.current_version.file.url; - a.download = a.href.split('/').pop(); + a.download = a.href.split('/').pop().replace(/\.xpi$/, '.zip'); document.body.appendChild(a).click(); document.body.removeChild(a); status.className = 'success'; status.textContent = `Download initiated for ${a.download}.`; }) .catch(err => { status.className = 'error'; status.textContent = `Error: ${err.message}.`; }) - .finally(() => setTimeout(() => { status.textContent = ''; status.className = ''; }, 5000)); + .finally(() => setTimeout(() => status.textContent = status.className = '', 5000)); } catch (err) { status.className = 'error'; status.textContent = 'Error: Invalid URL format.'; - setTimeout(() => { status.textContent = ''; status.className = ''; }, 5000); + setTimeout(() => status.textContent = status.className = '', 5000); } });