diff --git a/CefSharp.Wpf/WebView.cs b/CefSharp.Wpf/WebView.cs index 486e42129..557bf69b1 100644 --- a/CefSharp.Wpf/WebView.cs +++ b/CefSharp.Wpf/WebView.cs @@ -706,9 +706,9 @@ namespace CefSharp.Wpf throw new NotImplementedException(); } - public void ExecuteScript(string script) + public void ExecuteScriptAsync(string script) { - managedCefBrowserAdapter.ExecuteScript(script); + managedCefBrowserAdapter.ExecuteScriptAsync(script); } public object EvaluateScript(string script) diff --git a/CefSharp/IWebBrowser.h b/CefSharp/IWebBrowser.h index 2d35e25e3..bc4d7a3d6 100644 --- a/CefSharp/IWebBrowser.h +++ b/CefSharp/IWebBrowser.h @@ -53,22 +53,23 @@ namespace CefSharp void RegisterJsObject(String^ name, Object^ objectToBind); /// - /// Execute some Javascript code in the context of this WebBrowser. + /// Execute some JavaScript code in the context of this WebBrowser. As the method name implies, the script will be + /// executed asynchronously, and the method therefore returns before the script has actually been executed. /// - /// The Javascript code that should be executed. - void ExecuteScript(String^ script); + /// The JavaScript code that should be executed. + void ExecuteScriptAsync(String^ script); /// - /// Execute some Javascript code in the context of this WebBrowser, and return the result of the evaluation. + /// Execute some JavaScript code in the context of this WebBrowser, and return the result of the evaluation. /// - /// The Javascript code that should be executed. + /// The JavaScript code that should be executed. Object^ EvaluateScript(String^ script); /// - /// Execute some Javascript code in the context of this WebBrowser, and return the result of the evaluation. + /// Execute some JavaScript code in the context of this WebBrowser, and return the result of the evaluation. /// /// The Javascript code that should be executed. - /// The timeout after which the Javascript code execution should be aborted. + /// The timeout after which the JavaScript code execution should be aborted. Object^ EvaluateScript(String^ script, Nullable timeout); }; } diff --git a/CefSharp/ManagedCefBrowserAdapter.h b/CefSharp/ManagedCefBrowserAdapter.h index 3a4e1d46e..513dfa8ea 100644 --- a/CefSharp/ManagedCefBrowserAdapter.h +++ b/CefSharp/ManagedCefBrowserAdapter.h @@ -244,13 +244,13 @@ namespace CefSharp } } - void ExecuteScript(String^ script) + void ExecuteScriptAsync(String^ script) { auto browser = _renderClientAdapter->GetCefBrowser(); if (browser != nullptr) { - _scriptCore->Execute(browser, StringUtils::ToNative(script)); + _scriptCore->ExecuteAsync(browser, StringUtils::ToNative(script)); } } diff --git a/CefSharp/ScriptCore.cpp b/CefSharp/ScriptCore.cpp index 47d22bfb7..cf3e644ba 100644 --- a/CefSharp/ScriptCore.cpp +++ b/CefSharp/ScriptCore.cpp @@ -31,7 +31,7 @@ namespace CefSharp } } - void ScriptCore::Execute(CefRefPtr browser, CefString script) + void ScriptCore::ExecuteAsync(CefRefPtr browser, CefString script) { if (CefCurrentlyOn(TID_UI)) { diff --git a/CefSharp/ScriptCore.h b/CefSharp/ScriptCore.h index 58abf27a8..8445aeff7 100644 --- a/CefSharp/ScriptCore.h +++ b/CefSharp/ScriptCore.h @@ -25,7 +25,7 @@ namespace CefSharp _event = CreateEvent(NULL, FALSE, FALSE, NULL); } - DECL void Execute(CefRefPtr browser, CefString script); + DECL void ExecuteAsync(CefRefPtr browser, CefString script); IMPLEMENT_LOCKING(ScriptCore); IMPLEMENT_REFCOUNTING(ScriptCore);