ICoreWebView2Settings.get_IsWebMessageEnabled

The IsWebMessageEnabled property is used when loading a new HTML document. If set to TRUE, communication from the host to the top-level HTML document of the WebView is allowed using PostWebMessageAsJson, PostWebMessageAsString, and message event of window.chrome.webview. For more information, navigate to PostWebMessageAsJson. Communication from the top-level HTML document of the WebView to the host is allowed using the postMessage function of window.chrome.webview and add_WebMessageReceived method. For more information, navigate to add_WebMessageReceived. If set to false, then communication is disallowed. PostWebMessageAsJson and PostWebMessageAsString fails with E_ACCESSDENIED and window.chrome.webview.postMessage fails by throwing an instance of an Error object. The default value is TRUE.

\snippet ScenarioWebMessage.cpp IsWebMessageEnabled

interface ICoreWebView2Settings
@" propget"
HRESULT
get_IsWebMessageEnabled

Meta