I am building a navigation page that shows some contents inside an iframe. The requirement is that the navigation link that corresponds to the currently loaded page is highlighted. Frame contents is out of my control. Problems begin when the user uses back/forward buttons in his browser. The idea was to use history.replaceState to associate information about navigation link with the page, and to r