From 8c61683ad2511d82d2a6ba3db6204f8260ee1970 Mon Sep 17 00:00:00 2001 From: Dmitry Zabrodin <234518@mail.ru> Date: Thu, 25 Sep 2025 22:31:12 +0300 Subject: [PATCH] Update utils.ts - fix for Firefox in Firefox, if page is loaded using "file://" protocol, location.origin is "null", which causes an error: "URL constructor: null is not a valid URL." --- src/webR/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webR/utils.ts b/src/webR/utils.ts index 7b7d427b..8d7e819b 100644 --- a/src/webR/utils.ts +++ b/src/webR/utils.ts @@ -111,7 +111,7 @@ export function newCrossOriginWorker(url: string, cb: (worker: Worker) => void, export function isCrossOrigin(urlString: string) { if (IN_NODE) return false; const url1 = new URL(location.href); - const url2 = new URL(urlString, location.origin); + const url2 = new URL(urlString); if (url1.host === url2.host && url1.port === url2.port && url1.protocol === url2.protocol) { return false; }