Compartir a través de


CoreWebView2WebMessageReceivedEventArgs Class

Event args for the CoreWebView2.WebMessageReceived event.

Summary

Members Description
AdditionalObjects Additional received WebMessage objects.
Source Gets the URI of the document that sent this web message.
WebMessageAsJson Gets the message posted from the WebView content to the host converted to a JSON string.
TryGetWebMessageAsString Gets the message posted from the WebView content to the host as a string.

Properties

AdditionalObjects

readonly IVectorView<Object> AdditionalObjects

Additional received WebMessage objects. To pass AdditionalObjects via WebMessage to the app, use the chrome.webview.postMessageWithAdditionalObjects content API. Any DOM object type that can be natively representable that has been passed in to additionalObjects parameter will be accessible here. Currently a WebMessage object can be the CoreWebView2File type. Entries in the collection can be nullptr if null or undefined was passed. Cast the object to the native type to access its specific properties.

Source

readonly string Source

Gets the URI of the document that sent this web message.

WebMessageAsJson

readonly string WebMessageAsJson

Gets the message posted from the WebView content to the host converted to a JSON string. Run this operation to communicate using JavaScript objects.

Methods

TryGetWebMessageAsString

string TryGetWebMessageAsString()

Gets the message posted from the WebView content to the host as a string. Run this operation to communicate using simple strings.

Referenced by