Class MessageEvent

java.lang.Object
org.htmlunit.corejs.javascript.ScriptableObject
All Implemented Interfaces:
Serializable, Cloneable, org.htmlunit.corejs.javascript.ConstProperties, org.htmlunit.corejs.javascript.debug.DebuggableObject, org.htmlunit.corejs.javascript.Scriptable, org.htmlunit.corejs.javascript.SymbolScriptable

public class MessageEvent extends Event
A JavaScript object for MessageEvent.

For general information on which properties and functions should be supported, see Event definitions.

See Also:
  • Field Details

    • data_

      private Object data_
    • origin_

      private String origin_
    • lastEventId_

      private String lastEventId_
    • source_

      private Window source_
    • ports_

      private Object ports_
  • Constructor Details

    • MessageEvent

      public MessageEvent()
      Default constructor used to build the prototype.
    • MessageEvent

      public MessageEvent(Object data)
      Constructs a Message Event with the provided data.
      Parameters:
      data - the data
  • Method Details

    • jsConstructor

      public void jsConstructor(String type, org.htmlunit.corejs.javascript.ScriptableObject details)
      JavaScript constructor.
      Overrides:
      jsConstructor in class Event
      Parameters:
      type - the event type
      details - the event details (optional)
    • initMessageEvent

      public void initMessageEvent(String type, boolean canBubble, boolean cancelable, Object data, String origin, String lastEventId, Window source, Object ports)
      Initializes an event object.
      Parameters:
      type - the event type
      canBubble - can the event bubble
      cancelable - can the event be canceled
      data - the message
      origin - the scheme, hostname and port of the document that caused the event
      lastEventId - the identifier of the last event
      source - the window object that contains the document that caused the event
      ports - the message ports
    • getData

      public Object getData()
      Retrieves the data contained.
      Returns:
      the data contained
    • getOrigin

      public String getOrigin()
      Gets the URI of the document of origin.
      Returns:
      the origin
    • setOrigin

      public void setOrigin(String origin)
      Sets the URI of the document of origin.
      Parameters:
      origin - the origin
    • getLastEventId

      public String getLastEventId()
      Retrieves the identifier of the last event.
      Returns:
      the identified of the last event
    • getSource

      public Window getSource()
      Retrieves the data contained.
      Returns:
      the data contained
    • getPorts

      public Object getPorts()
      Returns the ports property.
      Returns:
      the ports property