Hi,
I have downloaded CefSharp from GitHub and using version 1.25.4.0 in my custom WinForm's application.
Problem is if I inject simple JavaScript code its working but jQuery code is not working.
In my webView_LoadCompleted event I am doing this
if (!javascriptLoaded)
{
string jsfunction = File.ReadAllText(@"selector.js");
webView.ExecuteScript(jsfunction);
//webView.EvaluateScript(jsfunction);
javascriptLoaded = true;
MessageBox.Show("Javascript has been injected ");
}
and my seelctor.js file is
var jq = document.createElement('script');
jq.src = "
http://code.jquery.com/jquery-latest.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
jQuery.noConflict();
$(document).click(function (e) {alert($(e.target).text());});
I have tried both ExecuteScript and EvaluateScript , both are not working !!!!
Could any one plz help here on what I am doing wrong here ???
Thanks,
Tony