MessageEvent

open class MessageEvent<out D : JsAny?>(val type: EventType<MessageEvent<D>>, init: MessageEventInit<D> = definedExternally) : Event(source)

The MessageEvent interface represents a message received by a target object.

MDN Reference

Constructors

Link copied to clipboard
constructor(type: EventType<MessageEvent<D>>, init: MessageEventInit<D> = definedExternally)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard

The bubbles read-only property of the Event interface indicates whether the event bubbles up through the DOM tree or not.

Link copied to clipboard
Link copied to clipboard

The cancelable read-only property of the Event interface indicates whether the event can be canceled, and therefore prevented as if the event never happened.

Link copied to clipboard
Link copied to clipboard

The read-only composed property of the or not the event will propagate across the shadow DOM boundary into the standard DOM.

Link copied to clipboard

The currentTarget read-only property of the Event interface identifies the element to which the event handler has been attached.

Link copied to clipboard
val data: D

The data read-only property of the The data sent by the message emitter; this can be any data type, depending on what originated this event.

Link copied to clipboard

The defaultPrevented read-only property of the Event interface returns a boolean value indicating whether or not the call to Event.preventDefault() canceled the event.

Link copied to clipboard

The eventPhase read-only property of the being evaluated.

Link copied to clipboard

The isTrusted read-only property of the when the event was generated by the user agent (including via user actions and programmatic methods such as HTMLElement.focus()), and false when the event was dispatched via The only exception is the click event, which initializes the isTrusted property to false in user agents.

Link copied to clipboard

The lastEventId read-only property of the unique ID for the event.

Link copied to clipboard
Link copied to clipboard

The origin read-only property of the origin of the message emitter.

Link copied to clipboard

The ports read-only property of the containing all MessagePort objects sent with the message, in order.

Link copied to clipboard

The source read-only property of the a WindowProxy, MessagePort, or a MessageEventSource (which can be a WindowProxy, message emitter.

Link copied to clipboard

The read-only target property of the dispatched.

Link copied to clipboard

The timeStamp read-only property of the Event interface returns the time (in milliseconds) at which the event was created.

Link copied to clipboard
open override val type: EventType<MessageEvent<D>>

Functions

Link copied to clipboard
open override fun asInit(): MessageEventInit<D>
Link copied to clipboard

The composedPath() method of the Event interface returns the event's path which is an array of the objects on which listeners will be invoked.

Link copied to clipboard

The preventDefault() method of the Event interface tells the user agent that if the event does not get explicitly handled, its default action should not be taken as it normally would be.

Link copied to clipboard

The stopImmediatePropagation() method of the If several listeners are attached to the same element for the same event type, they are called in the order in which they were added.

Link copied to clipboard

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.