Documentation/MessageEvent
classWORKER

MessageEvent

js/worker.js:886
MessageEvent(type, options)

Event carrying a structured-clone message payload. Used by direct Worker messaging and BroadcastChannel in both panel and Worker realms.

Parameters

NameTypeDescription
typestring
optionsoptionalObject
propertyWORKERreadonly

data

js/worker.js:895
data: *

Structured-clone payload carried by a message event.

propertyWORKERreadonly

direction

js/worker.js:944
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.

propertyWORKERreadonly

errorMessage

js/worker.js:935
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.

propertyWORKERreadonly

lastEventId

js/worker.js:911
lastEventId: string = ""

Last event identifier. JSplitter Worker messages do not use event-stream IDs, so this is an empty string.

propertyWORKERreadonly

origin

js/worker.js:903
origin: string = ""

Message origin. JSplitter Worker and BroadcastChannel messages use an empty string because they are not URL-origin messages.

propertyWORKERreadonly

ports

js/worker.js:927
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.

propertyWORKERreadonly

source

js/worker.js:919
source: * = null

Message source endpoint. JSplitter Worker and BroadcastChannel messages do not expose a MessagePort-style source, so this is null.