I get
Cannot read property 'toString' of undefined
That looks like you called the in-webworker prompt
/confirm
methods without a message, so that data
was undefined
. Not sure to say without the used code sample and the line number of the exception, though.
the return values of the latter two are not returned to the web worker
Well, why would they? Not even your message event handler does attempt to do anything with their return values.
Is it possible to modify the code to handle their return values?
No, since the worker-communication is asynchronous you never will be able to synchronous return
values from a message.