mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-05 19:54:53 +00:00
add ExecuteScript() to execute script w/o return value
This commit is contained in:
@@ -117,14 +117,29 @@ namespace CefSharp
|
||||
_clientAdapter->GetCefBrowser()->GetMainFrame()->Print();
|
||||
}
|
||||
|
||||
String^ WebBrowser::RunScript(String^ script)
|
||||
void WebBrowser::ExecuteScript(String^ script)
|
||||
{
|
||||
WaitForInitialized();
|
||||
|
||||
CefRefPtr<CefBrowser> browser = _clientAdapter->GetCefBrowser();
|
||||
CefRefPtr<CefFrame> frame = browser->GetMainFrame();
|
||||
|
||||
_scriptCore->Execute(frame, script);
|
||||
}
|
||||
|
||||
String^ WebBrowser::EvaluateScript(String^ script)
|
||||
{
|
||||
return EvaluateScript(script, TimeSpan.MaxValue);
|
||||
}
|
||||
|
||||
String^ WebBrowser::EvaluateScript(String^ script, TimeSpan timeout)
|
||||
{
|
||||
WaitForInitialized();
|
||||
|
||||
CefRefPtr<CefBrowser> browser = _clientAdapter->GetCefBrowser();
|
||||
CefRefPtr<CefFrame> frame = browser->GetMainFrame();
|
||||
|
||||
return _scriptCore->Evaluate(frame, script);
|
||||
return _scriptCore->Evaluate(frame, script, timeout);
|
||||
}
|
||||
|
||||
void WebBrowser::SetNavState(bool isLoading, bool canGoBack, bool canGoForward)
|
||||
|
||||
Reference in New Issue
Block a user