diff --git a/js/wasm/svelte/DownloadLink.svelte b/js/wasm/svelte/DownloadLink.svelte index f0b016211ed0e..609f66f1ab487 100644 --- a/js/wasm/svelte/DownloadLink.svelte +++ b/js/wasm/svelte/DownloadLink.svelte @@ -33,7 +33,7 @@ throw new Error("Wasm worker proxy is not available."); } - const url = new URL(href); + const url = new URL(href, window.location.href); const path = url.pathname; is_downloading = true; diff --git a/js/wasm/svelte/file-url.ts b/js/wasm/svelte/file-url.ts index 5e874dd4ebbaa..493e96e280ac6 100644 --- a/js/wasm/svelte/file-url.ts +++ b/js/wasm/svelte/file-url.ts @@ -9,7 +9,7 @@ export function should_proxy_wasm_src(src: MediaSrc): boolean { return false; } - const url = new URL(src); + const url = new URL(src, window.location.href); if (!is_self_host(url)) { // `src` is not accessing a local server resource, so we don't need to proxy this request to the Wasm worker. return false; @@ -33,7 +33,7 @@ export async function resolve_wasm_src(src: MediaSrc): Promise { return src; } - const url = new URL(src); + const url = new URL(src, window.location.href); const path = url.pathname; return maybeWorkerProxy .httpRequest({