I have the following code that attempts to manipulate the window.history stack:
console.log("before:" + window.history.length);
window.history.pushState(null, null, '/page1');
console.log("after:" + window.history.length);
This always prints the same in the before and after, even though I'm adding a state:
before:50
after:50
Why is pushState not incrementing the history length? By the way, length is always 50 even though I'm refreshing the page.