New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pushState is broken on certain browsers #5414

Closed
jaspermdegroot opened this Issue Jan 3, 2013 · 8 comments

Comments

Projects
None yet
5 participants
@jaspermdegroot
Member

jaspermdegroot commented Jan 3, 2013

Issues:

  • Nav back: The browser does not respond when you click the browser back button or a link with data-rel="back" for the first time (link enhanced as button does get active and focus style). If you click a second time it navigates back two pages in history.
  • Popup: A button that links to a popup gets the active and focus style and #&ui-state=dialog is appended to the url, but the popup doesn't open.

Test page:
http://jquerymobile.com/test/
http://jquerymobile.com/test/docs/pages/popup/index.html

Tested on:

  • IE10 / Win8
  • Opera Desktop 12.12 / Win7
  • Opera Mobile 12.10 / Android 4.1
  • Chrome 23.0.1271.100 / iOS 6.0.1
@jaspermdegroot

This comment has been minimized.

Show comment
Hide comment
@jaspermdegroot

jaspermdegroot Jan 3, 2013

Member

The issues don't occur with $.mobile.pushStateEnabled = false;.

Member

jaspermdegroot commented Jan 3, 2013

The issues don't occur with $.mobile.pushStateEnabled = false;.

@jaspermdegroot

This comment has been minimized.

Show comment
Hide comment
@jaspermdegroot

jaspermdegroot Jan 3, 2013

Member

Although the behaviour is a bit different this seems to be the same issue as reported for iOS6 #5401

Member

jaspermdegroot commented Jan 3, 2013

Although the behaviour is a bit different this seems to be the same issue as reported for iOS6 #5401

@jerone

This comment has been minimized.

Show comment
Hide comment
@jerone

jerone Jan 3, 2013

Contributor

Two issues with Opera Desktop 12.11 & 12.12:

  1. Confirmed that popups don't work, just as state above.
  2. Back button doesn't work on docs:
    a. Open http://jquerymobile.com/test/docs/pages/popup/index.html on new tab
    b. Press the docs "home" button.
    c. Press browser back button; see url go back to http://jquerymobile.com/test/docs/pages/popup/index.html, but page won't change.
Contributor

jerone commented Jan 3, 2013

Two issues with Opera Desktop 12.11 & 12.12:

  1. Confirmed that popups don't work, just as state above.
  2. Back button doesn't work on docs:
    a. Open http://jquerymobile.com/test/docs/pages/popup/index.html on new tab
    b. Press the docs "home" button.
    c. Press browser back button; see url go back to http://jquerymobile.com/test/docs/pages/popup/index.html, but page won't change.
@gabrielschulhof

This comment has been minimized.

Show comment
Hide comment
@gabrielschulhof

gabrielschulhof Jan 3, 2013

Contributor

The scenario described by @jerone can be generalized as follows:

Given a history of pages a -> b -> c -> d -> e, if you go back d <- e, the location changes but the page does not. If you then go back again (c <- d) and again (b <- c), and again, until you're supposed to be back on a, you will find that it works. Only the first backwards step is broken.

Behind the scenes, the first backwards step does not result in a "navigate" event (to which the function _handleHashChange is attached, which ultimately changes the page), whereas subsequent backwards steps do result in a "navigate" event.

Contributor

gabrielschulhof commented Jan 3, 2013

The scenario described by @jerone can be generalized as follows:

Given a history of pages a -> b -> c -> d -> e, if you go back d <- e, the location changes but the page does not. If you then go back again (c <- d) and again (b <- c), and again, until you're supposed to be back on a, you will find that it works. Only the first backwards step is broken.

Behind the scenes, the first backwards step does not result in a "navigate" event (to which the function _handleHashChange is attached, which ultimately changes the page), whereas subsequent backwards steps do result in a "navigate" event.

@johnbender

This comment has been minimized.

Show comment
Hide comment
@johnbender

johnbender Jan 3, 2013

Contributor

@gabrielschulhof

I'll take a look too. My guess is that one of the locks isn't disabled or similar.

Contributor

johnbender commented Jan 3, 2013

@gabrielschulhof

I'll take a look too. My guess is that one of the locks isn't disabled or similar.

@gabrielschulhof

This comment has been minimized.

Show comment
Hide comment
@gabrielschulhof

gabrielschulhof Jan 3, 2013

Contributor

FWIW, Opera/Linux does not trigger a popstate event when clicking a link to a perfectly normal page whereas Chrome/Linux does.

Contributor

gabrielschulhof commented Jan 3, 2013

FWIW, Opera/Linux does not trigger a popstate event when clicking a link to a perfectly normal page whereas Chrome/Linux does.

@ghost ghost assigned Wilto Jan 3, 2013

@johnbender johnbender closed this in 6602c21 Jan 8, 2013

@johnbender

This comment has been minimized.

Show comment
Hide comment
@johnbender

johnbender Jan 8, 2013

Contributor

@gabrielschulhof @uGoMobi

Would either of you mind verifying this works in your environments?

Contributor

johnbender commented Jan 8, 2013

@gabrielschulhof @uGoMobi

Would either of you mind verifying this works in your environments?

@jaspermdegroot

This comment has been minimized.

Show comment
Hide comment
@jaspermdegroot

jaspermdegroot Jan 8, 2013

Member

@johnbender

I tested latest on Opera and IE10 and I cannot longer reproduce the issue. Great!

Member

jaspermdegroot commented Jan 8, 2013

@johnbender

I tested latest on Opera and IE10 and I cannot longer reproduce the issue. Great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment