I would like to delete the previous history state, after the page is loaded.
This is a separate question from my other question; not merely an alternative.
I would like to delete the previous history state, after the page is loaded.
This is a separate question from my other question; not merely an alternative.
If you're loading new page via JS, you can replace
its location to use the same history entry:
window.location.replace(url);
See this answer.
Another way is to use history.replaceState
.