Share via


CoreWebView2ServiceWorker.WebMessageReceived Event

Definition

Add an event handler for the WebMessageReceived event. WebMessageReceived is fired, when the ICoreWebView2Settings::IsWebMessageEnabled setting is set 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