Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fafe651

Browse filesBrowse files
anonrigRafaelGSS
authored andcommitted
url: conform to origin getter spec changes
PR-URL: #48319 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
1 parent 764119b commit fafe651
Copy full SHA for fafe651

File tree

Expand file treeCollapse file tree

2 files changed

+3
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+3
-4
lines changed
Open diff view settings
Collapse file

‎lib/internal/url.js‎

Copy file name to clipboardExpand all lines: lib/internal/url.js
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,9 @@ class URL {
840840
if (path.length > 0) {
841841
try {
842842
const out = new URL(path);
843-
if (out.#context.scheme_type !== 1) {
843+
// Only return origin of scheme is `http` or `https`
844+
// Otherwise return a new opaque origin (null).
845+
if (out.#context.scheme_type === 0 || out.#context.scheme_type === 2) {
844846
return `${out.protocol}//${out.host}`;
845847
}
846848
} catch {
Collapse file

‎test/wpt/status/url.json‎

Copy file name to clipboardExpand all lines: test/wpt/status/url.json
-3Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,5 @@
1717
},
1818
"javascript-urls.window.js": {
1919
"skip": "requires document.body reference"
20-
},
21-
"url-origin.any.js": {
22-
"skip": "implementation not up to date"
2320
}
2421
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.