Implement wxWebView::SetProxy() for Edge backend

Currently it can only be called before Create() because it has to be
passed via the additional browser arguments and can't be changed later.
This commit is contained in:
Vadim Zeitlin 2023-08-25 23:43:49 +02:00
parent 7c5d30fb32
commit 0fd6cf99a3
4 changed files with 41 additions and 1 deletions

View file

@ -423,6 +423,17 @@ WebFrame::WebFrame(const wxString& url, bool isMain, wxWebViewWindowFeatures* wi
#endif
// Create the webview
m_browser = (windowFeatures) ? windowFeatures->GetChildWebView() : wxWebView::New();
#if wxUSE_WEBVIEW_EDGE
// With Edge the proxy can only be set before creation, so do it here.
if (wxWebView::IsBackendAvailable(wxWebViewBackendEdge))
{
wxString proxy;
if (wxGetEnv("http_proxy", &proxy))
m_browser->SetProxy(proxy);
}
#endif // wxUSE_WEBVIEW_EDGE
#ifdef __WXMAC__
if (m_isMainFrame)
{