CoreWebView2.WebMessageReceived Event


WebMessageReceived is raised when the IsWebMessageEnabled setting is set and the top-level document of the WebView runs

public event EventHandler<Microsoft.Web.WebView2.Core.CoreWebView2WebMessageReceivedEventArgs> WebMessageReceived;
member this.WebMessageReceived : EventHandler<Microsoft.Web.WebView2.Core.CoreWebView2WebMessageReceivedEventArgs> 
Public Custom Event WebMessageReceived As EventHandler(Of CoreWebView2WebMessageReceivedEventArgs) 

Event Type



The postMessage function is void postMessage(object) where object is any object supported by JSON conversion. When postMessage is called, the handler's Invoke method will be called with the object parameter postMessage converted to a JSON string.

Applies to