Last modified: 2014-02-12 23:47:46 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T43605, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 41605 - History pushState misbehaving on 4.0.4
History pushState misbehaving on 4.0.4
Status: RESOLVED FIXED
Product: MobileFrontend
Classification: Unclassified
beta (Other open bugs)
unspecified
All All
: High normal
: ---
Assigned To: Jon
: upstream
: 41670 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-31 19:56 UTC by Jon
Modified: 2014-02-12 23:47 UTC (History)
10 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Jon 2012-10-31 19:56:35 UTC
Observed on Nexus One 4.0.4 (works fine on other browsers including Chrome on same phone)

Click a link in an article
Notice that the address bar does not change but the article content does.

I created a minimum test case here:
http://jonrobson.me.uk/PushStateWorks

This shows pushState doesn't work from within functions.
Not sure what to do about this.
Comment 1 Jon 2012-11-02 20:41:44 UTC
*** Bug 41670 has been marked as a duplicate of this bug. ***
Comment 2 Arthur Richards 2012-12-03 19:58:53 UTC
https://gerrit.wikimedia.org/r/#/c/36593/3 merged
Comment 3 Jon 2012-12-03 20:35:33 UTC
Whoops looks like the bug number was wrong on that commit - not sure how to resolve that. That commit should have referred to bug 41446 so reopening
Comment 4 Jon 2012-12-04 21:35:29 UTC
Correct link http://jonrobson.me.uk/mobile/pushState.html
Comment 5 Jon 2012-12-05 22:30:22 UTC
http://caniuse.com/#search=history

Older iOS versions and Android 4.0.4 claim support, but implementation is too buggy to be useful. Partial support in other Safari browsers refers to other buggy behavior.
Comment 6 Jon 2012-12-06 00:50:58 UTC
This is a known upstream bug which is not being fixed (see http://stackoverflow.com/questions/10620843/pushstate-in-android-4-0 for background)

Bizarrely it's a regression - it worked in native browser for Android 2 but not 4 (!?!). It however does work in Chrome.

We will have to carefully feature detect this. I suggest blacklisting ua.match( /Android 4\./ ) && !ua.match( /Chrome/ ) - hacky - but necessary :( (Jon switches Chrome to be default browser)

Bad user agent:
Mozilla/5.0 (Linux; U; Android 4.0.4; en-gb; Galaxy Nexus Build/IMM76K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30

Working user agent:
Mozilla/5.0 (Linux; Android 4.0.4; Galaxy Nexus Build/IMM76K) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19
Comment 7 Arthur Richards 2012-12-06 18:24:34 UTC
Jon, is there a workaround for this for affected android browsers? Or an alternative way to approach the problem generally?

If we want to vary behavior for android chrome vs android 4* stock browser, we will have to look carefully at how X-Device currently works for these browsers (I haven't looked into this yet) - I'd prefer we not do this if we wind up having to introduce a new X-Device type (at least not until we have esi support in MobileFrontend) because that would mean we'll have to vary the varnish cache on yet-another-device/browser type.

From the threads I just breezed through on the subject, it sounds like this is not likely going to receive an upstream fix since Android is supposedly moving to use Chrome as the default browser in the future. But you can still vote to get the fix done:
http://code.google.com/p/android/issues/detail?id=23979
Comment 8 Jon 2012-12-06 18:26:18 UTC
We can feature detect this in JavaScript and turn off functionality for these browsers there - so no need to change X-Device related thing.

It's just a shame... ! :)
Comment 9 Arthur Richards 2012-12-06 18:32:20 UTC
Ok cool - it is srsly a bummer.
Comment 10 Jon 2012-12-06 22:00:57 UTC
Looking into this now
Comment 11 Jon 2012-12-06 22:21:37 UTC
https://gerrit.wikimedia.org/r/37321

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links