Browsing to maps.google.com often serves the desktop version on devices

Bug #1240485 reported by Olivier Tilloy
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
webbrowser-app
Fix Released
High
Olivier Tilloy

Bug Description

Observed intermittently on a Galaxy Nexus, this bug has been present for quite some time (it’s not a recent regression).
Steps to reproduce:

 1) On a mobile device, open the browser app, enter "maps.google.com" in the address bar, and validate
 2) Wait for the site to load
 3) Repeat steps 1 and 2 several times, and observe how sometimes the mobile version is served (expected) and sometimes the desktop version is served (unexpected)

Tags: ua-override
Revision history for this message
Olivier Tilloy (osomon) wrote :

I initially thought that the problem was with multiple requests being emitted to various domains when browsing to maps.google.com, leading to resetting the UA string various times on the webview. However it turns out that the only requests emitted are the following ones:

    https://maps.google.com/
    https://maps.google.com/mapfiles/home3.html
    about:blank

I patched the override mechanism to use the override for the current URL when about:blank is requested (instead of the default UA string), but it didn’t improve things. I also verified that this doesn’t have to do with pre-existing google cookies by completely wiping the cookie db. The problem persists.

Revision history for this message
Olivier Tilloy (osomon) wrote :

Interestingly, as initially pointed out by Bill Filler, when the mobile version is served, I’m not seeing the requests to about:blank. The other two requests are the same.

What’s weird is that it seems those two requests to about:blank are happening *after* the requests to maps.google.com, so they shouldn’t interfere. And even then, with the patched mechanism to send the same UA for those requests, I’m still getting the desktop version, so it seems there’s something else at work that decides which version to send.

Revision history for this message
Olivier Tilloy (osomon) wrote :

Confirming that it’s not just a UA override issue: I have added an override for maps.google.com where it sets the UA string to that of Chrome on Android (see https://developers.google.com/chrome/mobile/docs/user-agent), and I’m still not getting the mobile version all the time.

Revision history for this message
Olivier Tilloy (osomon) wrote :

As evidenced by daker, when we’re getting the desktop version, the first request (to https://maps.google.com/) is being sent with the default UA string, not the overridden one. This can be observed if running the browser app with the --inspector command-line switch, and then using the "network" view of the web inspector to spy on outgoing HTTP requests:

Request URL:https://maps.google.com/
Request Method:GET
Status Code:200 OK200 OK
Request Headersview source
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
User-Agent:Mozilla/5.0 (Ubuntu; Mobile) WebKit/537.21
Response Headersview source
Alternate-Protocol:443:quic
Cache-Control:private, max-age=0
Content-Type:text/html; charset=UTF-8
Date:Wed, 16 Oct 2013 14:34:54 GMT
Expires:-1
Server:GFE/2.0
Transfer-Encoding:chunked
X-Content-Type-Options:nosniff

Revision history for this message
Olivier Tilloy (osomon) wrote :

As I’d been suspecting for quite some time now, plugging in at the onNavigationRequested level is not the correct way of implementing the user agent override mechanism. We need to ensure that every single outgoing HTTP request has the correct UA header, and setting the UA globally on the webview doesn’t give us this guarantee.
It’s likely that we’re going to have to patch QtWebKit to plug in the override mechanism at a lower level.

Olivier Tilloy (osomon)
Changed in webbrowser-app:
assignee: nobody → Olivier Tilloy (osomon)
status: New → Confirmed
importance: Undecided → High
Adnane Belmadiaf (daker)
tags: added: ua-override
Revision history for this message
Adnane Belmadiaf (daker) wrote :

Happen to me servral times on google.com & google images, i need to refresh again to get the mobile version

Revision history for this message
Adnane Belmadiaf (daker) wrote :
Revision history for this message
Adnane Belmadiaf (daker) wrote :
Revision history for this message
Olivier Tilloy (osomon) wrote :

Fixed with the switch to oxide.

Changed in webbrowser-app:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.