The MessageEvent
interface represents a message received by a target object.
Documentation MessageEvent by Mozilla Contributors, licensed under CC-BY-SA 2.5.
See also:
Constructor
Variables
read onlyports:Array<MessagePort>
An array of MessagePort
objects representing the ports associated with the channel the message is being sent through (where appropriate, e.g. in channel messaging or when sending a message to a shared worker).
read onlysource:EitherType<Window, EitherType<MessagePort, ServiceWorker>>
A MessageEventSource
(which can be a WindowProxy
, MessagePort
, or ServiceWorker
object) representing the message emitter.
Methods
initMessageEvent(type:String, bubbles:Bool = false, cancelable:Bool = false, ?data:Dynamic, origin:String = "", lastEventId:String = "", ?source:Window, ?ports:Array<MessagePort>):Void
initMessageEvent(type:String, bubbles:Bool = false, cancelable:Bool = false, ?data:Dynamic, origin:String = "", lastEventId:String = "", ?source:MessagePort, ?ports:Array<MessagePort>):Void
initMessageEvent(type:String, bubbles:Bool = false, cancelable:Bool = false, ?data:Dynamic, origin:String = "", lastEventId:String = "", ?source:ServiceWorker, ?ports:Array<MessagePort>):Void
Initializes a message event. Do not use this anymore — use the MessageEvent.MessageEvent
constructor instead.