Mobile Web Wearable Web

HTML5 session history of browsing contexts

You can manage the session history of browsing contexts.

The history interface is used to save in the session history the page information that has been read by the user. You can also use the state object to directly store the page information which has already been analyzed in the URL, or general information which is not stored in the URL (such as location, or the scroll state of the page or a certain DOM element).

The main features of the HTML5 session history of browsing contexts API include:

  • Adding entries to the session history

    You can use the pushState() method of the history interface to add an entry to the session history. With the replaceState() method, you can update the session history details.

  • Detecting session history status changes

    The popstate event is fired when the user navigates to a page stored in the session history. The popstate event references the information stored with the pushState() or replaceState() methods, and enables you to change the status of the page based on the stored session history (such as moving focus to a certain DOM element).

Go to top