ConstOpen a port on a named channel for the calling window and announce it with port:connected.
Close a port and announce it with port:disconnected.
Omit name to list the ports of every channel.
Subscribe to port connection events. Returns an unsubscribe function.
Subscribe to port disconnection events. Returns an unsubscribe function.
Subscribe to incoming messages on ports. Returns an unsubscribe function.
null is not a message; the host refuses it as missing.
Send a message to one port, as a port:message event to that port's window.
port— cross-window named-channel messaging hub.Use port.connect to obtain a
portId; subsequent port.postMessage / port.postMessageTo calls route via that handle. Receivers subscribe with port.onMessage.