Did you run the test? I doubt you can do that with `on`, you will likely get an error, because you do not have the proper context object (`this`).
Therefore you will probably want to have something like:
```js
onAttach: worker => {
  let { tab } = worker;
  worker.on('message', readyState => {
    pagemod.destroy();
    // generate event name from `readyState`, e.g. `"loading"` becomes `onLoading`.
    let type = 'on' + readyState[0].toUpperCase() + readyState.substr(1);

    if (type in callbacks)
      callbacks[type](tab); 
  })
}
```