1 2 3 4 5 6 7
onconnect = function(e) { var port = e.ports[0]; port.addEventListener("message", function(e) { port.postMessage("shared worker is executing"); }); port.start(); }