mirror of
https://github.com/EverythingPublic/firefox-ext-dl.git
synced 2026-01-14 08:38:35 +00:00
feat: update index.html
This commit is contained in:
@@ -111,17 +111,17 @@
|
|||||||
.then(data => {
|
.then(data => {
|
||||||
const a = document.createElement('a');
|
const a = document.createElement('a');
|
||||||
a.href = data.current_version.file.url;
|
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.appendChild(a).click();
|
||||||
document.body.removeChild(a);
|
document.body.removeChild(a);
|
||||||
status.className = 'success';
|
status.className = 'success';
|
||||||
status.textContent = `Download initiated for ${a.download}.`;
|
status.textContent = `Download initiated for ${a.download}.`;
|
||||||
})
|
})
|
||||||
.catch(err => { status.className = 'error'; status.textContent = `Error: ${err.message}.`; })
|
.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) {
|
} catch (err) {
|
||||||
status.className = 'error'; status.textContent = 'Error: Invalid URL format.';
|
status.className = 'error'; status.textContent = 'Error: Invalid URL format.';
|
||||||
setTimeout(() => { status.textContent = ''; status.className = ''; }, 5000);
|
setTimeout(() => status.textContent = status.className = '', 5000);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user