I created a new WPF project and added Awesomium 1.6.3 WebControl to it.
Then I added this code to MainWindow.xaml.cs :
private void webControl1_Loaded(object sender, RoutedEventArgs e) { webControl1.LoadURL("https://www.google.com/"); } private void webControl1_DomReady(object sender, EventArgs e) { var wc = new WebClient(); webControl1.ExecuteJavascript(jQuery); webControl1.ExecuteJavascript(@"var __jq = jQuery.noConflict();"); webControl1.ExecuteJavascript(@"alert(__jq);"); using(var result = webControl1.ExecuteJavascriptWithResult(@"(function() { return 1; })();")) { MessageBox.Show(result.ToString()); }
And he warns β1β, and then βfunction (a, b) {...}β, which has failed, now that I think about it, but something else, this problem.
As soon as I uncomment the bottom code, it alerts β1β and then freezes. What for? How can I get some information about the links on the page? Or reliably pass some information back to C #? Or access the DOM from C #?
Edit: jQuery is just a string containing jQuery 1.7 code.
source share