summaryrefslogtreecommitdiff
path: root/Userland/Applications/Browser/History.cpp
diff options
context:
space:
mode:
authorMarcus Nilsson <brainbomb@gmail.com>2021-05-18 23:28:41 +0200
committerLinus Groh <mail@linusgroh.de>2021-05-18 23:14:37 +0100
commit7aaef8fd4b81b1639046639269993165cbe42a13 (patch)
treee4127c9154e87256bc8f967e1f123e896d3f2a8e /Userland/Applications/Browser/History.cpp
parent598d7f412730cdec08510d551aabab93c8c7685e (diff)
downloadserenity-7aaef8fd4b81b1639046639269993165cbe42a13.zip
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 <mail@linusgroh.de>
Diffstat (limited to 'Userland/Applications/Browser/History.cpp')
-rw-r--r--Userland/Applications/Browser/History.cpp2
1 files changed, 2 insertions, 0 deletions
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++;