From 799b465fac5672f167d6fec599fe167bce92862d Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Sat, 2 Sep 2023 23:25:07 +0200 Subject: [PATCH] LibWeb: Compare urls excluding fragments in Navigable::navigate() --- Userland/Libraries/LibWeb/HTML/Navigable.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/HTML/Navigable.cpp b/Userland/Libraries/LibWeb/HTML/Navigable.cpp index 3da0ab7518..beec6b90d4 100644 --- a/Userland/Libraries/LibWeb/HTML/Navigable.cpp +++ b/Userland/Libraries/LibWeb/HTML/Navigable.cpp @@ -886,7 +886,7 @@ WebIDL::ExceptionOr Navigable::navigate( // 1. If url equals navigable's active document's URL, // and initiatorOriginSnapshot is same origin with targetNavigable's active document's origin, // then set historyHandling to "replace". - if (url == active_document.url() && initiator_origin_snapshot.is_same_origin(active_document.origin())) + if (url.equals(active_document.url(), AK::URL::ExcludeFragment::Yes) && initiator_origin_snapshot.is_same_origin(active_document.origin())) history_handling = Bindings::NavigationHistoryBehavior::Replace; // 2. Otherwise, set historyHandling to "push".