W3cubDocs

/Haxe JavaScript

MessageEvent

package js.html

extends Event

Available on js

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

new(type:String, ?eventInitDict:Null<MessageEventInit>)

Throws:

null

DOMError

Variables

read onlydata:Dynamic

The data sent by the message emitter.

read onlylastEventId:String

A DOMString representing a unique ID for the event.

read onlyorigin:String

A USVString representing the origin of the message emitter.

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.

© 2005–2020 Haxe Foundation
Licensed under a MIT license.
https://api.haxe.org/js/html/MessageEvent.html