← Back to release summary

ExtendableMessageEvent on ServiceWorkerGlobalScope

Category
Service Worker
Type
New or changed feature
Status
Enabled by default (Chrome 51)
Intent stage
None

Summary

ServiceWorker.postMessage() now results in an ExtendableMessageEvent fired on ServiceWorkerGlobalScope as a 'message' event. ExtendableMessageEvent.waitUntil() extends its lifetime until a passed Promise is settled. Before this change, postMessage() resulted in a MessageEvent fired on the global scope.

Standards & signals

Docs: https://developer.mozilla.org/en-US/docs/Web/API/ExtendableMessageEvent

Samples: https://googlechrome.github.io/samples/service-worker/post-message/index.html

View on chromestatus.com