diff --git a/lib/internal/url.js b/lib/internal/url.js index beadc12cbaa913..c6b48ce94c7576 100644 --- a/lib/internal/url.js +++ b/lib/internal/url.js @@ -731,7 +731,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 f139ef7b03c27e..712ad96680a323 100644 --- a/test/wpt/status/url.json +++ b/test/wpt/status/url.json @@ -15,8 +15,5 @@ }, "javascript-urls.window.js": { "skip": "requires document.body reference" - }, - "url-origin.any.js": { - "skip": "implementation not up to date" } }