/// <summary> /// This is a helper for posting a message that is a simple string /// rather than a JSON string representation of a JavaScript object. This /// behaves in exactly the same manner as PostWebMessageAsJson but the /// `window.chrome.webview` message event arg's data property will be a string /// with the same value as webMessageAsString. Use this instead of /// PostWebMessageAsJson if you want to communicate via simple strings rather /// than JSON objects. /// </summary> /// <param name="json"></param> public void PostWebMessageAsString(string json) { if (_webView2WebView != null) { _webView2WebView.PostWebMessageAsString(json); } }