diff --git a/docs/changes.txt b/docs/changes.txt index 1e17fd875d..d524dbd0ff 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -255,6 +255,7 @@ wxGTK: - Dramatically optimize adding many items to wxChoice (Ian McInerney, #23443). - Improve document wxGLCanvas::CreateSurface() (Dan Gudmundsson, #23366). +- Fix loading WebKit2 extension when using wxWebView (Scott Talbert, #23497). wxMSW: diff --git a/src/gtk/webview_webkit2.cpp b/src/gtk/webview_webkit2.cpp index d53d29dff8..191cbcf2cc 100644 --- a/src/gtk/webview_webkit2.cpp +++ b/src/gtk/webview_webkit2.cpp @@ -533,7 +533,7 @@ wxgtk_initialize_web_extensions(WebKitWebContext *context, for ( size_t n = 0; n < WXSIZEOF(directories); ++n ) { - if ( !TrySetWebExtensionsDirectory(context, directories[n]) ) + if ( TrySetWebExtensionsDirectory(context, directories[n]) ) break; } } diff --git a/tests/controls/webtest.cpp b/tests/controls/webtest.cpp index c0eb77f529..98a817c997 100644 --- a/tests/controls/webtest.cpp +++ b/tests/controls/webtest.cpp @@ -232,9 +232,11 @@ TEST_CASE_METHOD(WebViewTestCase, "WebView", "[wxWebView]") // With WebKit SelectAll() sends a request to perform the selection to // another process via proxy and there doesn't seem to be any way to // wait until this request is actually handled, so loop here for some a - // bit before giving up. - for ( wxStopWatch sw; !m_browser->HasSelection() && sw.Time() < 50; ) - wxMilliSleep(1); + // bit before giving up. Avoid calling HasSelection() right away + // without wxYielding a bit because this seems to cause the extension + // to hang with webkit 2.40.0+. + for ( wxStopWatch sw; sw.Time() < 50; ) + wxYield(); #endif // wxUSE_WEBVIEW_WEBKIT2 CHECK(m_browser->HasSelection());