var worker = new Worker("worker.js");
// Watch for messages from the worker
worker.onmessage = function(e){
  // The message from the client:
  e.data
};

worker.postMessage("start");

/*===========
  The Client:
  ===========*/

onmessage = function(e){
  if ( e.data === "start" ) {
    // Do some computation
    done()
  }
};
function done(){
  // Send back the results to the parent page
  postMessage("done");
}