To prevent messages from being delivered before the destination is ready, client.postMessage() does not dispatch the message until one of the following has occurred on the destination: - 'DOMContentLoaded' event is fired. - onmessage is set. - startMessages() is called.
Docs: https://w3c.github.io/ServiceWorker/#dfn-client-message-queue