'Back' button and 'history.go(-1)' not working with Chrome

10,632

I found the problem with the page you have linked, I don't believe it to be an issue with Chrome.

When you load the page, it also loads two iFrames as the request to the site finishes. Chrome takes a somewhat different approach to history, allowing you to navigate not simply from changes in the URL displayed, but through every new individual browser-initiated request. When the iFrames load, Chrome adds history for each step of the page loading process, creating 4 separate history items. When you go back 1 "page load", it takes you back to the site you linked to, at a different step in the process. You aren't seeing anything change because as soon as that page loads, any unloaded iFrame now loads again.

If you do history.go(-8) or some other large number, you should see the page at that many pageloads ago. However, if the link is opened "in a new tab" then the history begins for that tab at the URL you told it to open, effectively limiting the history to the pages that occurred during that tab's lifespan.

This was tested on Chrome 34.0.1847.116 running under Ubuntu 13.10.

Share:
10,632

Related videos on Youtube

DoctorLouie
Author by

DoctorLouie

A developer with big dreams, aren't we all?

Updated on June 04, 2022

Comments

  • DoctorLouie
    DoctorLouie almost 2 years

    Got an odd problem, only persistent in Chrome browser. Can't imagine what would be the problem. Chrome's "Back" button doesn't work, nor does history.go(-1), but works fine on all other browsers. To see the problem simply click this link, which will asynchronously initiate searches on two separate services, or sites if you will. Upon click on any search result list item, we traverse to another page, but "Back" doesn't work for Chrome.

    http://vps-net.com/MSSMine/?search=some

    Any suggestions or ideas are welcome.

    • VMai
      VMai about 10 years
      "Back" button of my Chrome browsers (three different used last day and heavily used the back button) works.
    • DoctorLouie
      DoctorLouie about 10 years
      Yeah, but does it work on my example? Meaning once you click on of the search results for either RedMine or MicrosoftSearchServer(FleetAirArm), does the page go back in history if you use the "Back" button or "history.go(-1)"? I'm trying to find issue affecting this web app.
  • DoctorLouie
    DoctorLouie about 10 years
    So its a Chrome engineering issue, just as I suspected. Wonder why they take this approach, meaning for what constructive reason would they do this? This is not a common way of doing things, hence why all browsers are issue free, but Chrome has an issue due to their engineering. I'll have to write custom history functionality for my app anyway, but just wanted to get to the bottom of this. Thanks for you help in reviewing this :)
  • Catalyst
    Catalyst over 9 years
    This sounds like you are on windows, but you don't say so (Bold strategy assuming everyone is on windows). It also doesn't sound like you looked into the problem as a programming issue.