diff --git a/include/wx/gtk/webview_webkit.h b/include/wx/gtk/webview_webkit.h index f0f1873ea6..fa61f06ca5 100644 --- a/include/wx/gtk/webview_webkit.h +++ b/include/wx/gtk/webview_webkit.h @@ -160,7 +160,7 @@ private: #if wxUSE_WEBVIEW_WEBKIT2 bool CanExecuteEditingCommand(const gchar* command) const; void SetupWebExtensionServer(); - bool RunScriptInternal(const wxString& javascript, wxString* output = NULL); + bool RunScriptSync(const wxString& javascript, wxString* output = NULL); #endif WebKitWebView *m_web_view; diff --git a/src/gtk/webview_webkit2.cpp b/src/gtk/webview_webkit2.cpp index 5b7b15ae53..47afb82094 100644 --- a/src/gtk/webview_webkit2.cpp +++ b/src/gtk/webview_webkit2.cpp @@ -1141,7 +1141,8 @@ bool JSResultToString(GObject *object, GAsyncResult *result, wxString* output) return true; } -bool wxWebViewWebKit::RunScriptInternal(const wxString& javascript, wxString* output) +// Run the given script synchronously and return its result in output. +bool wxWebViewWebKit::RunScriptSync(const wxString& javascript, wxString* output) { GAsyncResult *result = NULL; webkit_web_view_run_javascript(m_web_view, @@ -1163,12 +1164,12 @@ bool wxWebViewWebKit::RunScript(const wxString& javascript, wxString* output) wxJSScriptWrapper wrapJS(javascript, &m_runScriptCount); wxString result; - bool isValidJS = RunScriptInternal(wrapJS.GetWrappedCode(), &result); + bool isValidJS = RunScriptSync(wrapJS.GetWrappedCode(), &result); if ( isValidJS && result == "true" ) { - RunScriptInternal(wrapJS.GetOutputCode(), output); - RunScriptInternal(wrapJS.GetCleanUpCode()); + RunScriptSync(wrapJS.GetOutputCode(), output); + RunScriptSync(wrapJS.GetCleanUpCode()); return true; }