Magnet link handler (#15)
* feat: Magnet link handler registration on the config page
This commit is contained in:
committed by
GitHub
parent
d58b327957
commit
d9b06fb518
@@ -69,6 +69,19 @@
|
||||
submitBtn.innerHTML = originalText;
|
||||
}
|
||||
});
|
||||
|
||||
// Read the URL parameters for a magnet link and add it to the download queue if found
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const magnetURI = urlParams.get('magnet');
|
||||
if (magnetURI) {
|
||||
document.getElementById('magnetURI').value = magnetURI;
|
||||
try {
|
||||
document.getElementById('submitDownload').click();
|
||||
history.replaceState({}, document.title, window.location.pathname);
|
||||
} catch (error) {
|
||||
console.error('Error adding download:', error);
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user