Merge lp:~osomon/webbrowser-app/ua-override-facebook.com into lp:webbrowser-app

Proposed by Olivier Tilloy
Status: Merged
Approved by: Bill Filler
Approved revision: 288
Merged at revision: 316
Proposed branch: lp:~osomon/webbrowser-app/ua-override-facebook.com
Merge into: lp:webbrowser-app
Diff against target: 9 lines (+1/-0)
1 file modified
src/Ubuntu/Components/Extras/Browser/ua-overrides.js (+1/-0)
To merge this branch: bzr merge lp:~osomon/webbrowser-app/ua-override-facebook.com
Reviewer Review Type Date Requested Status
Bill Filler (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+182862@code.launchpad.net

Commit message

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).

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Olivier Tilloy (osomon) wrote :

Looks like the images served with this override are low resolution. Wild guess: B2G users are assumed to have expensive data plans, so images are served low-res to save on bandwidth.

Switching back to the iphone UA string ("Mozilla/5.0 (iPhone; CPU iPhone OS 5_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3"), the same images are served in high resolution.

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

However, when using the iphone UA string, the login page suggests using the iphone app, and right after logging in, the user is presented with a full screen suggesting to download the iphone app instead of browsing the site.

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

Adding an "Android" token to the UA string also gets us high-res images (but of course it offers to install the android app).

Interestingly, I have noticed that only the iphone version offers a proper contextual OSK when entering the e-mail address to use as login (i.e. I’m getting the "@" and ".com" keys by default when this field has focus, whereas I’m getting the default keyboard layout when pretending to be android or firefox).

So it looks like the iphone version is better, if we except the popup that wants to install the iphone app after logging in.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Bill Filler (bfiller) wrote :

approved

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Ubuntu/Components/Extras/Browser/ua-overrides.js'
2--- src/Ubuntu/Components/Extras/Browser/ua-overrides.js 2013-08-16 14:48:28 +0000
3+++ src/Ubuntu/Components/Extras/Browser/ua-overrides.js 2013-08-29 10:51:47 +0000
4@@ -93,4 +93,5 @@
5 "dailymotion.com": ["Mobile", "Android; Mobile Safari"],
6 "amazon.co.uk": ["Mobile", "Android; Mobile"],
7 "ebay.co.uk": ["Mobile", "Android; Mobile"],
8+ "facebook.com": [/WebKit\/[.0-9]*/, "Apple$& Firefox/18"],
9 };

Subscribers

People subscribed via source and target branches

to status/vote changes: