diff --git a/Userland/Applications/Browser/History.cpp b/Userland/Applications/Browser/History.cpp index bddd81267c..964944a364 100644 --- a/Userland/Applications/Browser/History.cpp +++ b/Userland/Applications/Browser/History.cpp @@ -30,6 +30,15 @@ void History::push(const URL& url, String const& title) m_current++; } +void History::replace_current(const URL& url, String const& title) +{ + if (m_current == -1) + return; + + m_current--; + push(url, title); +} + History::URLTitlePair History::current() const { if (m_current == -1) diff --git a/Userland/Applications/Browser/History.h b/Userland/Applications/Browser/History.h index 05afcd8532..655c561989 100644 --- a/Userland/Applications/Browser/History.h +++ b/Userland/Applications/Browser/History.h @@ -20,6 +20,7 @@ public: void dump() const; void push(const URL& url, String const& title); + void replace_current(const URL& url, String const& title); void update_title(String const& title); URLTitlePair current() const;