Documentation/MessageEvent
MessageEvent(type, options)
Event carrying a structured-clone message payload. Used by direct Worker messaging and BroadcastChannel in both panel and Worker realms.
Parameters
| Name | Type | Description |
type | string | |
optionsoptional | Object | |
data: *
Structured-clone payload carried by a message event.
direction: string = ""
Direction of a JSplitter message: panel-to-worker, worker-to-panel, or broadcast for BroadcastChannel. Manually constructed MessageEvent objects use an empty string unless a direction is supplied explicitly.
errorMessage: string = ""
JSplitter reconstruction diagnostic for a messageerror event. It contains the structured-clone read failure reported by the receiving endpoint and is an empty string for an ordinary message event.
lastEventId: string = ""
Last event identifier. JSplitter Worker messages do not use event-stream IDs, so this is an empty string.
origin: string = ""
Message origin. JSplitter Worker and BroadcastChannel messages use an empty string because they are not URL-origin messages.
ports: Array = []
Transferred message ports. JSplitter does not expose MessagePort objects, so this array is empty. Trusted JSplitter messaging events expose it as an empty frozen array.
source: * = null
Message source endpoint. JSplitter Worker and BroadcastChannel messages do not expose a MessagePort-style source, so this is null.