top.location.replace creates history item in Safari/Chrome top.location.replace creates history item in Safari/Chrome google-chrome google-chrome

top.location.replace creates history item in Safari/Chrome


This works as expected now:

On Safari [5.1.7] location.replace() works as expected – the URL is replaced, nothing is added to the back button's queue, and nothing is added to the history menu.

On Chrome [21.0.1180.82] location.replace() is a little tricky – the URL is replaced and nothing is added to the back button's queue, but it does add an item to the history menu.


What makes this tricky is that there are two distinct history queues – the history menu and the back/forward buttons. Click and hold on the back and forward buttons to see their queue and compare with the history menu.

And the history queue of the back/forward buttons is tied to the active tab. Also, the button history remains even when you clear the history menu – at least until you close the tab.


There seems to be no solution at this point.