OrcaSlicer/src/slic3r/GUI/PrinterWebView.hpp
Branden Cash c675d979a7
fix(macos): disable App Transport Security (#1157)
* feat(webview): enable context menu

This enables the ability (at least on MacOS) to reload the webview.

* fix(webview): add handler for webview error

Adding this un-covered the following error when trying to load a the printer page using http and hostname:
```
OnError: error loading page about:blank  wxWEBVIEW_NAV_ERR_OTHER The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.

```

* fix(macos): disable App Transport Security policy

Disables the [App Transport Security](https://developer.apple.com/documentation/bundleresources/information_property_list/nsapptransportsecurity) policy that blocks loading http urls (via hostname...ip addresses were fine because ip addresses can't have certs, so they would be excluded from the ATS restriction).

Resolves #791
2023-06-01 00:14:47 +08:00

54 lines
1,002 B
C++

#ifndef slic3r_PrinterWebView_hpp_
#define slic3r_PrinterWebView_hpp_
#include "wx/artprov.h"
#include "wx/cmdline.h"
#include "wx/notifmsg.h"
#include "wx/settings.h"
#include "wx/webview.h"
#if wxUSE_WEBVIEW_EDGE
#include "wx/msw/webview_edge.h"
#endif
#include "wx/webviewarchivehandler.h"
#include "wx/webviewfshandler.h"
#include "wx/numdlg.h"
#include "wx/infobar.h"
#include "wx/filesys.h"
#include "wx/fs_arc.h"
#include "wx/fs_mem.h"
#include "wx/stdpaths.h"
#include <wx/panel.h>
#include <wx/tbarbase.h>
#include "wx/textctrl.h"
#include <wx/timer.h>
namespace Slic3r {
namespace GUI {
class PrinterWebView : public wxPanel {
public:
PrinterWebView(wxWindow *parent);
virtual ~PrinterWebView();
void load_url(wxString& url);
void UpdateState();
void OnClose(wxCloseEvent& evt);
void OnError(wxWebViewEvent& evt);
private:
wxWebView* m_browser;
long m_zoomFactor;
// DECLARE_EVENT_TABLE()
};
} // GUI
} // Slic3r
#endif /* slic3r_Tab_hpp_ */