1. EventSource: This interface is used to receive server-sent events. It connects to a server over HTTP and receives events in text/event-stream format without closing the connection.
2. WebSocket: This interface is used to enable Web applications to maintain bidirectional communications with server-side processes
3. window.postMessage(message, targetOrigin, transfer): This method is used to post message to the given window.
- Message can be structured objects, e.g. nested objects and arrays, can contain JavaScript values (strings, numbers, Date objects, etc), and can contain certain data objects such as File Blob, FileList, and ArrayBuffer objects.
- If the origin of the target window doesn't match the given origin, the message is discarded, to avoid information leakage. To send the message to the target regardless of origin, set the target origin to "*". To restrict the message to same-origin targets only, without needing to explicitly state the origin, set the target origin to "/".
- Objects listed in transfer are transferred, not just cloned, meaning that they are no longer usable on the sending side.
- MessagePort: MessagePort objects are transferable objects, Each channel has two message ports. Data sent through one port is received by the other port, and vice versa.
No comments:
Post a Comment