You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Navigation reload: Mention that soft reloads don't fire popstate #38229
The popstate event of the Window interface is fired when the active history entry changes while the user navigates the session history. It changes the current history entry to that of the last page the user visited or, if history.pushState() has been used to add a history entry to the history stack, that history entry is used instead.
Presumably a reload() simply loads the same page so the user hasn't traversed the history - there's no "pop". So why would anyone expect popstate to fire?
If it is reasonable that people might expect it to fire, of course we should add a note. Just wondering if that is true. If it needs to happen I will take care of it as part of #42254
@hamishwillee
I think people who use popstate might be surprised that it's fired for some soft navigations and not for others.
This is OK, but a note can help with the confusion.
Thanks @noamr. People get surprised by lots of things - if we documented everything that things don't do we'd have lots of cruft. It doesn't do any harm in this case IMO, but not a habit to get into.
What I've done is added the note in #42303 but pointed out my issue with this. If the reviewer is strongly against then we'll close this issue - otherwise it will go in.
Thanks @noamr. People get surprised by lots of things - if we documented everything that things don't do we'd have lots of cruft. It doesn't do any harm in this case IMO, but not a habit to get into.
What I've done is added the note in #42303 but pointed out my issue with this. If the reviewer is strongly against then we'll close this issue - otherwise it will go in.
SG! I actually don't remember the discussion that had led me to opening the issue in the first place..
Activity
kb42 commentedon Jul 18, 2025
Is anyone else working on this? If not, I can take this issue
noamr commentedon Jul 21, 2025
Go for it
hamishwillee commentedon Dec 8, 2025
Hi @noamr
According to
popstateeventPresumably a
reload()simply loads the same page so the user hasn't traversed the history - there's no "pop". So why would anyone expectpopstateto fire?If it is reasonable that people might expect it to fire, of course we should add a note. Just wondering if that is true. If it needs to happen I will take care of it as part of #42254
noamr commentedon Dec 8, 2025
@hamishwillee
I think people who use
popstatemight be surprised that it's fired for some soft navigations and not for others.This is OK, but a note can help with the confusion.
hamishwillee commentedon Dec 8, 2025
Thanks @noamr. People get surprised by lots of things - if we documented everything that things don't do we'd have lots of cruft. It doesn't do any harm in this case IMO, but not a habit to get into.
What I've done is added the note in #42303 but pointed out my issue with this. If the reviewer is strongly against then we'll close this issue - otherwise it will go in.
noamr commentedon Dec 9, 2025
SG! I actually don't remember the discussion that had led me to opening the issue in the first place..
hamishwillee commentedon Dec 15, 2025
It's going in - no arguments from the reviewer, and "does not harm". Thanks very much.