Do not set user agent on webview creation. It caused not loading of the webview edge backend when running 2 different versions of PS.

This commit is contained in:
David Kocik 2024-04-30 10:15:31 +02:00
parent 79a7abeca6
commit f6e8a1e898

View File

@ -21,8 +21,7 @@ wxWebView* WebView::CreateWebView(wxWindow * parent, const wxString& url)
if (webView) { if (webView) {
wxString correct_url = url.empty() ? wxString("") : wxURI(url).BuildURI(); wxString correct_url = url.empty() ? wxString("") : wxURI(url).BuildURI();
#ifdef __WIN32__ #ifdef __WIN32_
webView->SetUserAgent(wxString::Format("PrusaSlicer/v%s", SLIC3R_VERSION));
webView->Create(parent, wxID_ANY, correct_url, wxDefaultPosition, wxDefaultSize); webView->Create(parent, wxID_ANY, correct_url, wxDefaultPosition, wxDefaultSize);
//We register the wxfs:// protocol for testing purposes //We register the wxfs:// protocol for testing purposes
//webView->RegisterHandler(wxSharedPtr<wxWebViewHandler>(new wxWebViewArchiveHandler("wxfs"))); //webView->RegisterHandler(wxSharedPtr<wxWebViewHandler>(new wxWebViewArchiveHandler("wxfs")));
@ -34,7 +33,6 @@ wxWebView* WebView::CreateWebView(wxWindow * parent, const wxString& url)
// And the memory: file system // And the memory: file system
//webView->RegisterHandler(wxSharedPtr<wxWebViewHandler>(new wxWebViewFSHandler("memory"))); //webView->RegisterHandler(wxSharedPtr<wxWebViewHandler>(new wxWebViewFSHandler("memory")));
webView->Create(parent, wxID_ANY, correct_url, wxDefaultPosition, wxDefaultSize); webView->Create(parent, wxID_ANY, correct_url, wxDefaultPosition, wxDefaultSize);
webView->SetUserAgent(wxString::Format("PrusaSlicer/v%s", SLIC3R_VERSION));
#endif #endif
#ifndef __WIN32__ #ifndef __WIN32__
Slic3r::GUI::wxGetApp().CallAfter([webView] { Slic3r::GUI::wxGetApp().CallAfter([webView] {