WebViewWebMessageReceivedEventArgs.WebView
property · WebViewWebMessageReceivedEventArgs · cAlgo.API
DesktopCLICloud
WebView Control.
Environment behaviour
CLI — not supported. Never raised in the CLI: the events that pass it never fire there (WebView.WebMessageReceived).
Cloud — not supported. Never raised in the cloud: the events that pass it never fire there (WebView.WebMessageReceived).
Definition
public WebView WebView {get;}
webViewWebMessageReceivedEventArgs.WebView: WebView
Returns WebView
Examples
protected override void OnStart()
{
var webView = new WebView();
webView.WebMessageReceived += OnWebMessageReceived;
Chart.AddControl(webView);
webView.NavigateAsync("https://ctrader.com/");
}
private void OnWebMessageReceived(WebViewWebMessageReceivedEventArgs args)
{
args.WebView.ExecuteScriptAsync("console.log('message received')");
}
def on_start(self):
webView = WebView()
webView.WebMessageReceived += self.on_web_message_received
api.Chart.AddControl(webView)
webView.NavigateAsync("https://ctrader.com/")
def on_web_message_received(self, args):
args.WebView.ExecuteScriptAsync("console.log('message received')")