|
|
@ -967,18 +967,13 @@ function registerMagnetHandler() { |
|
|
|
|
|
|
|
|
|
|
|
function handleDownloadParam() { |
|
|
|
function handleDownloadParam() { |
|
|
|
// Extract torrent URL from download param in WebUI URL hash
|
|
|
|
// Extract torrent URL from download param in WebUI URL hash
|
|
|
|
const hashParams = getHashParamsFromUrl(); |
|
|
|
const downloadHash = "#download="; |
|
|
|
const url = hashParams.download; |
|
|
|
if (location.hash.indexOf(downloadHash) !== 0) |
|
|
|
if (!url) |
|
|
|
|
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
// Remove the download param from WebUI URL hash
|
|
|
|
const url = location.hash.substring(downloadHash.length); |
|
|
|
delete hashParams.download; |
|
|
|
// Remove the processed hash from the URL
|
|
|
|
let newHash = Object.toQueryString(hashParams); |
|
|
|
history.replaceState('', document.title, (location.pathname + location.search)); |
|
|
|
newHash = newHash ? ('#' + newHash) : ''; |
|
|
|
|
|
|
|
history.replaceState('', document.title, |
|
|
|
|
|
|
|
(location.pathname + location.search + newHash)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
showDownloadPage([url]); |
|
|
|
showDownloadPage([url]); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|