Select Edge as the default backend on MSW

If enabled and available at runtime use the Edge backend.
This is probably more useful for most users.
This commit is contained in:
Tobias Taschner
2021-02-04 22:35:03 +01:00
parent b351e7762d
commit 788bef2cf2
4 changed files with 29 additions and 18 deletions

View File

@@ -374,9 +374,7 @@ WebFrame::WebFrame(const wxString& url) :
// Create a log window
new wxLogWindow(this, _("Logging"), true, false);
// Create the webview
wxString backend = wxWebViewBackendDefault;
#ifdef __WXMSW__
#if wxUSE_WEBVIEW_EDGE
// Check if a fixed version of edge is present in
// $executable_path/edge_fixed and use it
wxFileName edgeFixedDir(wxStandardPaths::Get().GetExecutablePath());
@@ -387,18 +385,12 @@ WebFrame::WebFrame(const wxString& url) :
wxWebViewEdge::MSWSetBrowserExecutableDir(edgeFixedDir.GetFullPath());
wxLogMessage("Using fixed edge version");
}
if (wxWebView::IsBackendAvailable(wxWebViewBackendEdge))
{
wxLogMessage("Using Edge backend");
backend = wxWebViewBackendEdge;
}
else
{
wxLogMessage("Edge backend not available");
}
#endif
m_browser = wxWebView::New(backend);
wxLogMessage("Backend version: %s", wxWebView::GetBackendVersionInfo(backend).ToString());
// Create the webview
m_browser = wxWebView::New();
// Log backend information
wxLogMessage("Backend: %s Version: %s", m_browser->GetClassInfo()->GetClassName(),
wxWebView::GetBackendVersionInfo().ToString());
#ifdef __WXMAC__
// With WKWebView handlers need to be registered before creation
m_browser->RegisterHandler(wxSharedPtr<wxWebViewHandler>(new wxWebViewArchiveHandler("wxfs")));