Change window.pushState to window.history.pushState.