Language

CoreWebView2ServiceWorker.WebMessageReceived Event

Definition

WebMessageReceived is fired when the IsWebMessageEnabled setting is set to true and the worker runs self.chrome.webview.postMessage. The postMessage function is void postMessage(object) where object is any object supported by JSON conversion.

If the worker calls postMessage multiple times, the corresponding WebMessageReceived events are guaranteed to be fired in the same order.

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

Applies to