Specifically, calling the following snippet of code:
history.replaceState(undefined, undefined, "#" + value)
will correctly not affect the back button behavior of the current page, but will add an entry to the "browsing history" page, which I don’t want. Pictured below is Chrome’s History page, but this also happens in Firefox.
Is there some way to replace the current URL without adding an entry to the user’s browsing history?
I’m inquiring about the standalone Browser History page, not the actual page navigation history that the Back button uses.

The correct way to make it is using the replaceState method. In the tests that I did, it's working very well in both chrome and firefox - the history has not changed after running replaceState.
来源:https://stackoverflow.com/questions/26793130/history-replacestate-still-adds-entries-to-the-browsing-history