MessageReceived Event  
 

The MessageReceived event occurs when a script running inside the browser sends a message to the host.

Syntax

Sub object_MessageReceived ( [Index As Integer,] ByVal Message As String )

Remarks

The MessageReceived event occurs when a message is posted from JavaScript code in the web page using window.chrome.webview.postMessage. The message is delivered as a string, which can be accessed using the Message argument. The message may be structured JSON data, or it may be a simple JSON formatted string. This event provides a two-way communication channel between the page content and the host application, allowing developers to implement hybrid scenarios where the web page can notify the native host of user actions, requests, or state changes.

If the AllowMessages property is set to False, this event will not be raised.

See Also

AllowMessages Property, PostWebMessage Method