Class MessageEvent

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.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:
    Mozilla documentation, Serialized Form
    • Field Detail

      • data_

        private java.lang.Object data_
      • origin_

        private java.lang.String origin_
      • lastEventId_

        private java.lang.String lastEventId_
      • source_

        private Window source_
      • ports_

        private java.lang.Object ports_
    • Constructor Detail

      • MessageEvent

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

        public MessageEvent​(java.lang.Object data)
        Constructs a Message Event with the provided data.
        Parameters:
        data - the data
    • Method Detail

      • jsConstructor

        public void jsConstructor​(java.lang.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​(java.lang.String type,
                                     boolean canBubble,
                                     boolean cancelable,
                                     java.lang.Object data,
                                     java.lang.String origin,
                                     java.lang.String lastEventId,
                                     Window source,
                                     java.lang.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 java.lang.Object getData()
        Retrieves the data contained.
        Returns:
        the data contained
      • getOrigin

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

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

        public java.lang.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 java.lang.Object getPorts()
        Returns the ports property.
        Returns:
        the ports property