This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
* Some parts of this feature may have varying levels of support.
PopStateEvent is an interface for the popstate event.
A popstate event is dispatched to the window every time the active history entry changes between two history entries for the same document. If the history entry being activated was created by a call to history.pushState() or was affected by a call to history.replaceState(), the popstate event's state property contains a copy of the history entry's state object.
PopStateEvent()Creates a new PopStateEvent object.
This interface also inherits the properties of its parent, Event.
PopStateEvent.state Read only
Returns a copy of the information that was provided to pushState() or replaceState().
hasUAVisualTransition Read only
Returns true if the user agent performed a visual transition for this navigation before dispatching this event, or false otherwise.
This interface has no methods of its own, but inherits the methods of its parent, Event.
| Specification |
|---|
| HTML> # the-popstateevent-interface> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
PopStateEvent |
16 | 14 | 11 | 15 | 6 | 18 | 14 | 14 | 6 | 1.0 | 4.4 | 6 |
PopStateEvent |
4 | 12 | 4 | ≤12.1 | 6 | 18 | 4 | ≤12.1 | 6 | 1.0 | 4.4 | 6 |
hasUAVisualTransition |
118 | 118 | No | 104 | 18 | 118 | No | 79 | 18 | 25.0 | 118 | 18 |
state |
4 | 12 | 4 | ≤12.1 | 6 | 18 | 4 | ≤12.1 | 6 | 1.0 | 4.4 | 6 |
popstate eventhashchange event
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/PopStateEvent