Examples

When the following code is used inside the main thread to set up a message channel between it and a service worker for sending messages between the two, the event object of onmessage will be a ServiceWorkerMessageEvent.