zixaphir / appchan-x

The most comprehensive, feature filled 4chan userscript.
http://zixaphir.github.io/appchan-x
Other
133 stars 61 forks source link

JSON navigation does not work properly in chrome #934

Closed mahkoh closed 9 years ago

mahkoh commented 9 years ago

The first "go back" or "go forward" is always ignored. After that it works properly. E.g.

  1. Go to http://boards.4chan.org/qa/
  2. Go to any thread
  3. Reload the page (e.g. press F5)
  4. Press the back button
  5. The URL changes nothing else happens

This seems to be the problem:

    <% if (type === 'crx') { %>
    # blink/webkit throw a popstate on page load. Not what we want.
    popstateHack = ->
      $.off window, 'popstate', popstateHack
      $.on  window, 'popstate', Navigate.popstate

    $.on window, 'popstate', popstateHack
    <% } else { %>
    $.on  window, 'popstate', Navigate.popstate
    <% } %>

Removing the popstateHack fixes the problem.

mahkoh commented 9 years ago

885 and #829 are the same issue. Do you remember why you added and this workaround and can you still reproduce the original problem?

I've been using a modified version without the popstateHack for a few hours and haven't noticed anything unusual.

ccd0 commented 9 years ago

Blink used to fire a popstate event when the document was loaded the first time, instead of just when using the forward/back buttons to navigate between states of the document. But this has been fixed: https://crbug.com/63040