mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-19 01:45:54 +08:00
Do not allow url ouside connect and backbutton back to loading in connect tab.
This commit is contained in:
parent
31088cc139
commit
2e0cb6a9be
@ -642,7 +642,17 @@ void ConnectWebViewPanel::on_script_message(wxWebViewEvent& evt)
|
||||
}
|
||||
void ConnectWebViewPanel::on_navigation_request(wxWebViewEvent &evt)
|
||||
{
|
||||
//TODO Stop request out of connect
|
||||
if (evt.GetURL() == m_default_url) {
|
||||
m_reached_default_url = true;
|
||||
return;
|
||||
}
|
||||
if (evt.GetURL() == (GUI::format_wxstr("file:///%1%/web/connection_failed.html", boost::filesystem::path(resources_dir()).generic_string()))) {
|
||||
return;
|
||||
}
|
||||
if (m_reached_default_url && !evt.GetURL().StartsWith(m_default_url)) {
|
||||
BOOST_LOG_TRIVIAL(info) << evt.GetURL() << " does not start with default url. Vetoing.";
|
||||
evt.Veto();
|
||||
}
|
||||
}
|
||||
void ConnectWebViewPanel::logout()
|
||||
{
|
||||
|
@ -200,6 +200,7 @@ protected:
|
||||
void run_script_bridge(const wxString& script) override {run_script(script); }
|
||||
private:
|
||||
void on_user_token(UserAccountSuccessEvent& e);
|
||||
bool m_reached_default_url {false};
|
||||
};
|
||||
|
||||
class PrinterWebViewPanel : public WebViewPanel
|
||||
|
Loading…
x
Reference in New Issue
Block a user