Files
sousa-gecko/dom/websocket/tests/iframe_webworker_wss.html
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

22 lines
635 B
HTML

<html><body>
Creating WebSocket
<script type="application/javascript">
onmessage = function(e) {
parent.postMessage(e.data, '*');
}
try{
let worker = new Worker("data:text/javascript,try { let ws = new WebSocket('ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket_hello'); ws.onerror = () => postMessage('SecurityError: The operation is insecure.'); } catch(e) { postMessage(e.name + ': ' + e.message); }");
worker.onerror = (e) => {
parent.postMessage(e.message, '*');
close();
};
worker.onmessage = (e) => {
parent.postMessage(e.data, '*');
close();
};
} catch(e) {}
</script>
</body></html>