Reader: allow book urls to be relative (#29)

This commit is contained in:
Balki
2024-07-26 14:00:54 +00:00
committed by GitHub
parent 660f6bbf1e
commit 835b70a840
+1 -1
View File
@@ -324,6 +324,6 @@ const params = new URLSearchParams(location.search)
const url = params.get('url')
if (url) fetch(url)
.then(res => res.blob())
.then(blob => open(new File([blob], new URL(url).pathname)))
.then(blob => open(new File([blob], new URL(url, window.location.origin).pathname)))
.catch(e => console.error(e))
else dropTarget.style.visibility = 'visible'