pushState () accepts three parameters: a state object, a header (which is currently ignored), and (optionally) a URL. Let's look at each of these three parameters in more detail:
state object — The state object is a JavaScript object which is associated with the new history entry created by pushState(). Whenever
the user enters a new state, the popstate event is triggered, and the state property of the event contains a copy of the history object's state record.
The state object can be anything that can be serialized. Because Firefox saves state objects to the user disk so they can be restored
after restarting the browser, we will impose a limit on the size of 640 thousand characters in the serialized representation of the state object. if you pass a state object whose serialized representation is larger than that for pushState (), the method will throw an exception. If you need more space than this, you are advised to use sessionStorage and / or LocalStorage.
title — Firefox currently ignores this parameter, although it may use it in the future. Passing the empty string here should be safe
against future method changes. In addition, you can pass a short header for the state you are moving to.
URL — The new history entry URL is given by this parameter. Note that the browser won't attempt to load this URL after a call to
pushState (), but it may try to load the URL later, for example after restarting the user. The new URL does not have to be absolute; if it is relative, it is resolved relative to the current url. The new URL must have the same source as the current URL; otherwise, pushState () throws an exception. This parameter is optional; if not specified, it is set to the current URL of the document.