Illustrates the initialization handshake between two RemoteMessenger instances, one in the Main Process and one in a WebView, using a RemoteReady message.
flowchart
postMessage1(["postMessage({ kind: RemoteReady, ... })"])
rm1--1-->postMessage1--2-->rm2
subgraph MainProcess
rm1["m1 = RemoteMessenger< MainProcessApi,WebViewApi >"]
end
subgraph WebView
rm2["RemoteMessenger< WebViewApi,MainProcessApi >"]
end
This flowchart details the initial communication flow for setting up two RemoteMessenger instances. rm1 in the Main Process sends a postMessage with kind: RemoteReady. This message is then received by rm2 in the WebView, initiating the readiness handshake between the two processes.
Use this diagram to explain how inter-process communication (IPC) channels are initialized and how readiness is established between different application components, such as a main process and a webview.
This pattern can be adapted for any two-way communication setup requiring an explicit readiness check. Modify message kinds, add more steps for authentication or capability negotiation, or extend to multiple communicating parties.