Browser not recognized as mobile browser on multiple sites

Bug #1215002 reported by Michael Hall
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
webbrowser-app
Fix Released
High
Olivier Tilloy
webbrowser-app (Ubuntu)
Fix Released
High
Olivier Tilloy

Bug Description

Recently (as of 2013-08-20 builds) visiting certain sites on my Nexus 4 and Nexus 7 shows a non-mobile-friendly version of the website, or in the case of Google+ refuses to load at all because it doesn't like the browser's identity. See images below.

Related branches

Revision history for this message
Michael Hall (mhall119) wrote :
Revision history for this message
Michael Hall (mhall119) wrote :
Revision history for this message
Michael Hall (mhall119) wrote :
Changed in webbrowser-app:
status: New → Confirmed
assignee: nobody → Olivier Tilloy (osomon)
Olivier Tilloy (osomon)
Changed in webbrowser-app:
importance: Undecided → High
Bill Filler (bfiller)
Changed in webbrowser-app (Ubuntu):
status: New → Confirmed
importance: Undecided → High
assignee: nobody → Olivier Tilloy (osomon)
Revision history for this message
Bill Filler (bfiller) wrote :

the user-agent string was recently modified to not use iphone/iphone but instead use
 "Mozilla/5.0 (Ubuntu; %1) WebKit/%2"
where
    // %1: form factor (Mobile, Tablet, Desktop)
    // %2: WebKit version

There are a list of overrides for specific sites found here on the phone:
/usr/lib/arm-linux-gnueabihf/qt5/qml/Ubuntu/Components/Extras/Browser/ua-overrides.js

You can try adding the sites that are having problems to this file, with an Android, iPhone, (or other) override and report back what works best for the sites in question.

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

I’ve just briefly tested Google+ on my galaxy nexus, and it seems to work fine. I was able to log in at http://plus.google.com (in the process I was offered to install the app, because the UA string is being overridden, incorporating an 'Android' token), and I could browse the feed of latest posts, as well as access the page to write a new post.

Michael (or anyone else), can you reproduce the issue for Google+ with the latest image?

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

I’ve briefly tested facebook on my galaxy nexus, and it seems to work fine too. The contents are adapted to a mobile device too.
The presentation does look different to what I’m getting on Chrome on Android (and much uglier), but the app seems usable.

Olivier Tilloy (osomon)
Changed in webbrowser-app:
status: Confirmed → In Progress
Revision history for this message
Olivier Tilloy (osomon) wrote :

I have linked a branch (and submitted a MR) to fix the case of facebook.com (in order to get modern content, just like android and iphone, not unstyled content like in the 90s).

Regarding Google+, I have not seen the issue myself, but it’s been reported that sometimes navigating there works, but at some point during navigation it stops working and then the error page that suggests to upgrade the browser pops up.
I have observed something similar: sometimes I’m getting a desktop version for a given website (there is no override rule defined for this domain), but then suddenly when navigating to some other place under the same domain, I’m getting the mobile version.
I think this is because we’re re-setting the UA string on each navigation request (there may be several requests for one given page, if it embeds iframes or if it uses XMLHTTPRequests), but the property is not contextual to the request, it’s global to the webview.
I don’t know how to address this with QtWebKit (but IIRC Chris said that this would be solved in Oxide, as the UA string property would be contextual).

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

Fix committed into lp:webbrowser-app at revision 316, scheduled for release in webbrowser-app, milestone ubuntu-13.04-month-5

Changed in webbrowser-app:
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package webbrowser-app - 0.22+13.10.20130919.3-0ubuntu1

---------------
webbrowser-app (0.22+13.10.20130919.3-0ubuntu1) saucy; urgency=low

  [ Alexandre Abreu ]
  * Add a 'maximized' command line parameter mostly to enhance the
    control for webapps launch.

  [ Olivier Tilloy ]
  * Use the value of APP_ID to set the application name. This ensures
    that webapps (which run with a unique app ID) will write their data
    where they ought to, and that they won’t have access to other apps’
    cache and cookies. (LP: #1226085)
  * Add a unity action to clear the navigation history.
  * Override the UA string for facebook.com to ensure we’re getting
    touch-enabled content. Without this override, we were getting
    unstyled mobile content from the 90s. Impersonating an iphone or
    android would offer to install the respective applications when
    logging in. The 'Firefox' token gets us the right content (and
    pretending to be AppleWebKit seems to be necessary too, otherwise
    the layout is busted). (LP: #1215002)

  [ Ubuntu daily release ]
  * Automatic snapshot from revision 318
 -- Ubuntu daily release <email address hidden> Thu, 19 Sep 2013 15:52:17 +0000

Changed in webbrowser-app (Ubuntu):
status: Confirmed → Fix Released
Olivier Tilloy (osomon)
Changed in webbrowser-app:
status: Fix Committed → 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