From 835b70a8409b372643cadb68d39c4e2c21ec3d74 Mon Sep 17 00:00:00 2001 From: Balki Date: Fri, 26 Jul 2024 14:00:54 +0000 Subject: [PATCH] Reader: allow book urls to be relative (#29) --- reader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reader.js b/reader.js index 629fc30..9939f16 100644 --- a/reader.js +++ b/reader.js @@ -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'