Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /websockets/Create-non-absolute-url.any.html - WPT Dashboard Interop Dashboard
- /websockets/Create-non-absolute-url.any.worker.html - WPT Dashboard Interop Dashboard
[
"test",
"?",
null,
123,
].forEach(input => {
test(() => {
const url = new URL(input, location);
url.protocol = "ws";
const ws = new WebSocket(input);
assert_equals(ws.url, url.href);
ws.close();
}, `Create WebSocket - Pass a non absolute URL: ${input}`);
});