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
22 lines
635 B
HTML
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>
|