Thanks. I'll look into that. It was recommended exactly for backtracking but I get that if you want to leave it's a whole lot of backpaddling :-)
Use history.replaceState() instead of history.pushState() and you're all good.
Use history.replaceState() instead of history.pushState() and you're all good.