Get to know MDN better
This feature is well established and works across many devices and browser versions. It’s been available across browsers since April 2018.
Note: This feature is only available in Service Workers.
The ExtendableMessageEvent() constructor creates a new ExtendableMessageEvent object.
A string with the name of the event. It is case-sensitive and browsers set it to messageerror or message.
options OptionalAn object that, in addition of the properties defined in ExtendableEvent(), can have the following properties:
data OptionalThe event's data; this can be any data type. It defaults to null.
origin OptionalA string that defines the origin of the corresponding service worker's environment settings object. It defaults to "".
lastEventId OptionalA string that defines the last event ID of the event source. It defaults to "".
source OptionalThe Client, ServiceWorker or MessagePort that sent the message. It defaults to null.
ports OptionalAn array containing the MessagePort objects connected to the channel sending the message. It defaults to an empty array.
A new ExtendableMessageEvent object.
| Service Workers Nightly # dom-extendablemessageevent-extendablemessageevent |
Enable JavaScript to view this browser compatibility table.
This page was last modified on May 13, 2024 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.