open class WebMessage

The Java representation of the HTML5 PostMessage event. See https://html.spec.whatwg.org/multipage/comms.html#the-messageevent-interfaces for definition of a MessageEvent in HTML5.

Summary

Public constructors

Creates a WebMessage.

WebMessage(data: String!, ports: Array<WebMessagePort!>!)

Creates a WebMessage.

Public methods
open String!

getData()

Returns the data of the message.

open Array<WebMessagePort!>?

getPorts()

Returns the ports that are sent with the message, or null if no port is sent.

Public constructors

WebMessage

WebMessage(data: String!)

Creates a WebMessage.

Parameters
data String!: the data of the message.

Public methods

getData

open fun getData(): String!

Returns the data of the message.

getPorts

open fun getPorts(): Array<WebMessagePort!>?

Returns the ports that are sent with the message, or null if no port is sent.

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2025-02-10 UTC.