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
16 lines
339 B
JavaScript
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");
|
|
}
|
|
};
|