From 7aaef8fd4b81b1639046639269993165cbe42a13 Mon Sep 17 00:00:00 2001 From: Marcus Nilsson Date: Tue, 18 May 2021 23:28:41 +0200 Subject: [PATCH] Browser: Don't add multiple page reloads to history When reloading a page multiple times, it was also added multiple times to the history. This commit prohibits an url to be added twice in a row. Fixes #7264 Co-authored-by: Linus Groh --- Userland/Applications/Browser/History.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Userland/Applications/Browser/History.cpp b/Userland/Applications/Browser/History.cpp index c738ad53ec..da960f8432 100644 --- a/Userland/Applications/Browser/History.cpp +++ b/Userland/Applications/Browser/History.cpp @@ -20,6 +20,8 @@ void History::dump() const void History::push(const URL& url) { + if (!m_items.is_empty() && m_items[m_current] == url) + return; m_items.shrink(m_current + 1); m_items.append(url); m_current++;