Stop scroll on popstate
// from https://stackoverflow.com/questions/10742422/prevent-browser-scroll-on-html5-history-popstate if ('scrollRestoration' in history) { history.scrollRestoration = 'manual'; }