1. 7.6 Browsing the Web
      1. 7.6.1 History traversal
        1. The PopStateEvent interface
        2. The HashChangeEvent interface
        3. The PageTransitionEvent interface
      2. 7.6.2 Unloading documents
        1. The BeforeUnloadEvent interface

7.6 Browsing the Web

7.6.1 History traversal The PopStateEvent interface
event . state

Returns a copy of the information that was provided to pushState() or replaceState(). The HashChangeEvent interface

Support: hashchangeChrome for Android 81+Chrome 5+iOS Safari 4.0+Safari 5+Firefox 3.6+Samsung Internet 4+Edge 12+UC Browser for Android 12.12+IE 8+Opera 10.6+Opera Mini NoneFirefox for Android 68+

Source: caniuse.com

event . oldURL

Returns the URL of the session history entry that was previously current.

event . newURL

Returns the URL of the session history entry that is now current. The PageTransitionEvent interface
event . persisted

For the pageshow event, returns false if the page is newly being loaded (and the load event will fire). Otherwise, returns true.

For the pagehide event, returns false if the page is going away for the last time. Otherwise, returns true, meaning that (if nothing conspires to make the page unsalvageable) the page might be reused if the user navigates back to this page.

Things that can cause the page to be unsalvageable include:

7.6.2 Unloading documents The BeforeUnloadEvent interface

There are no BeforeUnloadEvent-specific initialization methods.

The BeforeUnloadEvent interface is a legacy interface which allows prompting to unload to be controlled not only by canceling the event, but by setting the returnValue attribute to a value besides the empty string. Authors should use the preventDefault() method, or other means of canceling events, instead of using returnValue.