Class ExtendableMessageEvent
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
The ExtendableMessageEvent interface of the Service Worker API represents the event object of a ServiceWorkerGlobalScopemessage event fired on a service worker (when a message is received on the ServiceWorkerGlobalScope from another context) — extends the lifetime of such events.
[Value("ExtendableMessageEvent")]
public class ExtendableMessageEvent : ExtendableEvent
- Inheritance
-
ExtendableMessageEvent
- Inherited Members
Remarks
This interface inherits from the ExtendableEvent interface.
-Using Service Workers
-Service workers basic code example
-Channel Messaging
Constructors
ExtendableMessageEvent()
public ExtendableMessageEvent()
ExtendableMessageEvent(string, ExtendableMessageEventInit)
The ExtendableMessageEvent() constructor creates a new ExtendableMessageEvent object.
public ExtendableMessageEvent(string type, ExtendableMessageEventInit eventInitDict = null)
Parameters
typestringeventInitDictExtendableMessageEventInit
Remarks
Properties
Data
The data read-only property of the
ExtendableMessageEvent interface returns the event's data. It can be any
data type.
[Value("data")]
public dynamic Data { get; }
Property Value
- dynamic
Any data type.
Remarks
LastEventId
The lastEventID read-only property of the
ExtendableMessageEvent interface represents, in server-sent events, the last event ID of the event source. This is an empty string.
[Value("lastEventId")]
public string LastEventId { get; }
Property Value
- string
A string.
Remarks
Origin
The origin read-only property of the
ExtendableMessageEvent interface returns the origin of the
Client that sent the message.
[Value("origin")]
public string Origin { get; }
Property Value
- string
A string.
Remarks
Ports
The ports read-only property of the
ExtendableMessageEvent interface returns the array containing the
MessagePort objects representing the ports of the associated message
channel (the channel the message is being sent through.)
[Value("ports")]
public MessagePort[] Ports { get; }
Property Value
- MessagePort[]
An array of MessagePort objects.
Remarks
Source
The source read-only property of the
ExtendableMessageEvent interface returns a reference to the
Client object from which the message was sent.
[Value("source")]
public Union140? Source { get; }
Property Value
- Union140?
A Client, ServiceWorker or MessagePort
object.