1 2 3 4 5 6 7 8
onconnect = function(evt) { var mc = new MessageChannel(); evt.ports[0].postMessage(42, [mc.port2]); mc.port1.onmessage = function(e) { mc.port1.postMessage(e.data); } }