diff options
-rw-r--r-- | Applications/Browser/Tab.cpp | 9 | ||||
-rw-r--r-- | Applications/Browser/Tab.h | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/Applications/Browser/Tab.cpp b/Applications/Browser/Tab.cpp index 7c3f9c7c75..18a690ddb2 100644 --- a/Applications/Browser/Tab.cpp +++ b/Applications/Browser/Tab.cpp @@ -132,6 +132,12 @@ Tab::Tab(Type type) hooks().on_load_start = [this](auto& url) { m_location_box->set_icon(nullptr); m_location_box->set_text(url.to_string()); + + // don't add to history if back or forward is pressed + if (!m_is_history_navigation) + m_history.push(url); + m_is_history_navigation = false; + update_actions(); update_bookmark_button(url.to_string()); }; @@ -404,8 +410,7 @@ Tab::~Tab() void Tab::load(const URL& url, LoadType load_type) { - if (load_type == LoadType::Normal) - m_history.push(url); + m_is_history_navigation = (load_type == LoadType::HistoryNavigation); if (m_type == Type::InProcessWebView) m_page_view->load(url); diff --git a/Applications/Browser/Tab.h b/Applications/Browser/Tab.h index 2db9cfcf6c..c7adea48ad 100644 --- a/Applications/Browser/Tab.h +++ b/Applications/Browser/Tab.h @@ -109,6 +109,8 @@ private: String m_title; RefPtr<const Gfx::Bitmap> m_icon; + + bool m_is_history_navigation { false }; }; URL url_from_user_input(const String& input); |