diff --git a/src/msw/webview_edge.cpp b/src/msw/webview_edge.cpp index 26eb2c7f98..35022b5980 100644 --- a/src/msw/webview_edge.cpp +++ b/src/msw/webview_edge.cpp @@ -20,6 +20,7 @@ #include "wx/filename.h" #include "wx/module.h" +#include "wx/stdpaths.h" #include "wx/thread.h" #include "wx/private/jsscriptwrapper.h" @@ -142,11 +143,12 @@ bool wxWebViewEdge::Create(wxWindow* parent, Bind(wxEVT_SIZE, &wxWebViewEdge::OnSize, this); - LPCWSTR subFolder = nullptr; - LPCWSTR additionalBrowserSwitches = nullptr; + wxString userDataPath = wxStandardPaths::Get().GetUserLocalDataDir(); HRESULT hr = wxCreateWebView2EnvironmentWithDetails( - subFolder, nullptr, additionalBrowserSwitches, + nullptr, + userDataPath.wc_str(), + nullptr, Callback( [this](HRESULT WXUNUSED(result), IWebView2Environment* environment) -> HRESULT {