ICoreWebView2WebMessageReceivedEventArgs.get_WebMessageAsJson

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

For example, the following postMessage runs result in the following WebMessageAsJson values.

postMessage({'a': 'b'})      L"{\"a\": \"b\"}"
postMessage(1.2)             L"1.2"
postMessage('example')       L"\"example\""

The caller must free the returned string with CoTaskMemFree. See API Conventions.

interface ICoreWebView2WebMessageReceivedEventArgs
@" propget"
HRESULT
get_WebMessageAsJson
Suggestion Box / Bug Report