diff --git a/lib/internal/url.js b/lib/internal/url.js index 7227aac12a7762..1813b86962f4cd 100644 --- a/lib/internal/url.js +++ b/lib/internal/url.js @@ -840,7 +840,9 @@ class URL { if (path.length > 0) { try { const out = new URL(path); - if (out.#context.scheme_type !== 1) { + // Only return origin of scheme is `http` or `https` + // Otherwise return a new opaque origin (null). + if (out.#context.scheme_type === 0 || out.#context.scheme_type === 2) { return `${out.protocol}//${out.host}`; } } catch { diff --git a/test/wpt/status/url.json b/test/wpt/status/url.json index 67dbfb3528b5d6..0b4beb54549495 100644 --- a/test/wpt/status/url.json +++ b/test/wpt/status/url.json @@ -17,8 +17,5 @@ }, "javascript-urls.window.js": { "skip": "requires document.body reference" - }, - "url-origin.any.js": { - "skip": "implementation not up to date" } }