sajad torkamani

In a nutshell

The window.popstate event is fired whenever the current history entry changes. This can be when:

  • User presses the browser’s back or forward button.
  • You programmatically invoke history.back(), history.forward() or history.go().

Other notes

  • To avoid annoying pop-ups, browsers may not fire the popstate event if the page hasn’t been interacted with.

Sources

Tagged: Web APIs