public void PressKey(int code) { WebMessageKeyPress keyPress = new WebMessageKeyPress() { keyCode = code }; PostMessageSender.SendWebMessage(keyPress, webView.CoreWebView2); // Activity monitor keeps track of last keypress time, so we need to tell it when a key has been pressed activityInterface.RegisterKeyPress(); }
private void btnGo_Click(object sender, EventArgs e) { if (webView != null && webView.CoreWebView2 != null && !String.IsNullOrEmpty(txtAddressBar.Text)) { webView.CoreWebView2.Navigate(txtAddressBar.Text); webView.Focus(); } WebMessageGenericEvent jsEvent = new WebMessageGenericEvent("onFoobar", new { teflon = "bumblefart" }); PostMessageSender.SendWebMessage(jsEvent, webView.CoreWebView2); }
public bool getChannelList(bool minifiedVersion = false) { if (_eventActive) { WebMessageChannelListReadyEvent jsevent = new WebMessageChannelListReadyEvent() { Status = 0, ChannelData = channelData }; PostMessageSender.SendWebMessage(jsevent, _webView); } return(true); }