WebView2.WebMessageReceived Event
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Occurs when a new HTML document is loaded.
// Register
event_token WebMessageReceived(TypedEventHandler<WebView2, CoreWebView2WebMessageReceivedEventArgs const&> const& handler) const;
// Revoke with event_token
void WebMessageReceived(event_token const* cookie) const;
// Revoke with event_revoker
WebView2::WebMessageReceived_revoker WebMessageReceived(auto_revoke_t, TypedEventHandler<WebView2, CoreWebView2WebMessageReceivedEventArgs const&> const& handler) const;
public event TypedEventHandler<WebView2,CoreWebView2WebMessageReceivedEventArgs> WebMessageReceived;
function onWebMessageReceived(eventArgs) { /* Your code */ }
webView2.addEventListener("webmessagereceived", onWebMessageReceived);
webView2.removeEventListener("webmessagereceived", onWebMessageReceived);
- or -
webView2.onwebmessagereceived = onWebMessageReceived;
Public Custom Event WebMessageReceived As TypedEventHandler(Of WebView2, CoreWebView2WebMessageReceivedEventArgs)