Class MessagePort
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
The MessagePort interface of the Channel Messaging API represents one of the two ports of a MessageChannel, allowing messages to be sent from one port and listening out for them arriving at the other.
[Value("MessagePort")]
public class MessagePort : EventTarget, MessageEventTarget
- Inheritance
-
MessagePort
- Implements
- Inherited Members
Remarks
Constructors
MessagePort()
public MessagePort()
Properties
Onclose
[Value("onclose")]
public EventHandlerNonNull Onclose { get; set; }
Property Value
Methods
Close()
The close() method of the MessagePort
interface disconnects the port, so it is no longer active. This stops the flow of
messages to that port.
[Value("close")]
public GlobalObject.Undefined Close()
Returns
Remarks
PostMessage(dynamic, StructuredSerializeOptions)
The postMessage() method of the
MessagePort interface sends a message from the port, and optionally,
transfers ownership of objects to other browsing contexts.
[Value("postMessage")]
public GlobalObject.Undefined PostMessage(dynamic message, StructuredSerializeOptions options = null)
Parameters
messagedynamicoptionsStructuredSerializeOptions
Returns
Remarks
PostMessage(dynamic, List<Object>)
The postMessage() method of the
MessagePort interface sends a message from the port, and optionally,
transfers ownership of objects to other browsing contexts.
[Value("postMessage")]
public GlobalObject.Undefined PostMessage(dynamic message, List<Object> transfer)
Parameters
Returns
Remarks
Start()
The start() method of the MessagePort
interface starts the sending of messages queued on the port. This method is only needed
when using AddEventListener(string, Action?, Union26); it is implied when using
MessagePort.Message.
[Value("start")]
public GlobalObject.Undefined Start()