Files
sousa-gecko/dom/websocket/tests/websocket_https_worker.js
T
Jaimukund Bhan acb4da8b14 Bug 2034642 - Defer WebSocket mixed-content checks to InititalizeConnection. r=valentin
Move the mixed-content blocking checks from synchronous Init to asynchronous
InitializeConnection in WebSocket.cpp. This aligns the behaviour with the
standard specifications where mixed-content failures trigger asynchronous error
rather than throwing a synchronous SecurityError during WebSocket construction

Differential Revision: https://phabricator.services.mozilla.com/D308017
2026-06-29 10:01:29 +00:00

16 lines
339 B
JavaScript

onmessage = function () {
try {
let ws = new WebSocket(
"ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket_hello"
);
ws.onerror = function () {
postMessage("not created");
};
ws.onopen = function () {
postMessage("created");
};
} catch (e) {
postMessage("not created");
}
};