#ifndef slic3r_GUI_WebView_hpp_ #define slic3r_GUI_WebView_hpp_ #include #include #include #include class wxWebView; class wxWindow; wxDECLARE_EVENT(EVT_WEBVIEW_RECREATED, wxCommandEvent); class WebView { public: static wxWebView *CreateWebView(wxWindow *parent, wxString const &url); #if wxUSE_WEBVIEW_EDGE static bool CheckWebViewRuntime(); static bool DownloadAndInstallWebViewRuntime(); #endif static void LoadUrl(wxWebView * webView, wxString const &url); // Returns the URL truncated at the first '?' or '#', so a query/fragment carrying secrets // (e.g. a session-handoff token) is never written to a log. static wxString RedactUrl(const wxString& url); static bool RunScript(wxWebView * webView, wxString const & msg); // Marks "wx" as registered so CreateWebView's deferred add skips the duplicate. static void MarkScriptMessageHandlerAdded(wxWebView * webView); // On Windows, a WebView2 backend created during a GUI rebuild (language switch) can come up // ignoring every navigation. A panel that gets true here recreates its view on first Show(). static bool NeedsRecreateOnShow(); static void RecreateAll(); }; #endif // !slic3r_GUI_WebView_hpp_