private void EvaluateJavaScript(string s) { try { EvaluateJavaScriptResult = webBrowser.EvaluateScript(s) ?? "null"; } catch (Exception e) { MessageBox.Show("Error while evaluating Javascript: " + e.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error); } }