CoreWebView2Settings.IsWebMessageEnabled Property
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.
Determines whether communication from the host to the top-level HTML document of the WebView is allowed.
public bool IsWebMessageEnabled { get; set; }
member this.IsWebMessageEnabled : bool with get, set
Public Property IsWebMessageEnabled As Boolean
Property Value
Remarks
This 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(String), PostWebMessageAsString(String), and message event of window.chrome.webview
. Communication from the top-level HTML document of the WebView to the host is allowed using window.chrome.webview.postMessage
function and the WebMessageReceived event. If set to false
, then communication is disallowed. PostWebMessageAsJson(String) and PostWebMessageAsString(String) fail and window.chrome.webview.postMessage
fails by throwing an instance of an Error object. The default value is true
.