Closed Bug 1476704 Opened 6 years ago Closed 5 years ago

Behavior of window.history.back and browser back button not identical.

Categories

(Developer Documentation Graveyard :: General, enhancement, P2)

All
Other
enhancement

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: privat, Unassigned)

References

()

Details

:: Developer Documentation Request

      Request Type: Correction
     Gecko Version: unspecified
 Technical Contact: 

:: Details

When using history.pushState(), the window.history.back() function and the browser back button behave different. In which context does this happen? How to overcome that?

See also: https://stackoverflow.com/questions/51404384/history-pushstate-history-back-and-back-button-behave-different
Priority: -- → P2

closing; this is now being tracked at https://github.com/mdn/sprints/issues/994

Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → INCOMPLETE

Added the following to History API section that describes history.pushState:

Note: Although history.back normally behaves the same way as clicking the Back button, the history.back method acts differently from the browser Back button after using history.pushState. Calling history.back after history.pushState does not raise a popstate event while clicking on the browser's Back button does raise the event.

Please let me know if I have left anything important out of the description.

You need to log in before you can comment on or make changes to this bug.