1 onconnect = function(event) {
2 var port = event.ports[0];
3 port.postMessage("Worker connected.");
4 port.onmessage = function(event2) {
5 port.postMessage("Worker got a port.");
6 var anotherport = event2.data.port;
8 anotherport.onmessage = function(event3) {
9 anotherport.postMessage("Worker got a message via the passed port.");