mirror of
https://github.com/EverythingPublic/firefox-ext-dl.git
synced 2026-01-13 16:18:04 +00:00
feat: update index.html
This commit is contained in:
@@ -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);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user