1onmessage = () => { 2 var protocol = location.protocol.replace('http', 'ws'); 3 var url = protocol + '//' + location.host + '/echo-with-no-extension'; 4 var ws = new WebSocket(url); 5 6 ws.onopen = () => postMessage('PASS'); 7 ws.onclose = () => postMessage('FAIL'); 8} 9