LibWeb: Update document url after same-document back/forward navigation

Seems like a specification bug, but other browsers update url before
popstate event is fired and so should we.

Fixes back/forward navigation on GitHub.
This commit is contained in:
Aliaksandr Kalenik 2024-04-21 11:18:35 +02:00 committed by Alexander Kalenik
commit 23d683cf6b
Notes: sideshowbarker 2024-07-17 17:49:11 +09:00
3 changed files with 8 additions and 3 deletions

View file

@ -4070,6 +4070,9 @@ void Document::update_for_history_step_application(JS::NonnullGCPtr<HTML::Sessio
// 5. If documentIsNew is false, then:
if (!document_is_new) {
// NOTE: Not in the spec, but otherwise document's url won't be updated in case of a same-document back/forward navigation.
set_url(entry->url());
// AD HOC: Skip this in situations the spec steps don't account for
if (update_navigation_api) {
// 1. Update the navigation API entries for a same-document navigation given navigation, entry, and "traverse".