

Looking around the web most places say it is "not used", and all the solutions here pass null for that. the second argument to history.pushState() is a title.(The browser is also likely to include that string in the address bar when on the page, which is ugly.) location.href should be used for the URL. Solutions which pass a string like 'no-back-button' or 'pagename' seem to work OK, until you then try a Refresh/Reload on the page, at which point a "Page not found" error is generated when the browser tries to locate a page with that as its URL. the third argument to history.pushState() is a url.history.pushState() does work on all of them. history.forward() (my old solution) does not work on Mobile Safari - it seems to do nothing (i.e., the user can still go back).

History.pushState(null, document.title, location.href) Window.addEventListener('popstate', function (event) I offer the following (tested on Internet Explorer 11, Firefox, Chrome, and Safari): history.pushState(null, document.title, location.href) I came across this, needing a solution which worked correctly and "nicely" on a variety of browsers, including Mobile Safari (iOS 9 at time of posting).
