I have a listener to onpopstate event. I want to get record of history which was popped without travelling in history. I could do history.forward() and get state, but that will cause side-effects I don't want to see.
window.addEventListener('popstate', (event) => {
prevHistoryRecord = // How to get it without history.forward()
});