browser needs its own UA string

Bug #1179596 reported by Adnane Belmadiaf on 2013-05-13
36
This bug affects 6 people
Affects Status Importance Assigned to Milestone
webbrowser-app
Fix Released
High
Olivier Tilloy
webbrowser-app (Ubuntu)
High
Unassigned

Bug Description

Actually the browser uses the iPhone user-agent which is not really a good idea, because most of webapps/websites will try to get users to download there iOS apps using popups & wrong links to itunes, we should try to find out the best combination, here are some UA examples :

Firefox for Android:
Mozilla/5.0 (Android; Mobile; rv:13.0) Gecko/13.0 Firefox/13.0
Mozilla/5.0 (Android; Tablet; rv:13.0) Gecko/13.0 Firefox/13.0

iPhone:
Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25

Android:
Mozilla/5.0 (Linux; Android 4.0.4; Galaxy Nexus Build/IMM76B) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.133 Mobile Safari/535.19

Blackberry 10:
Mozilla/5.0 (BB10; <Device Model>) AppleWebKit/<WebKit Version> (KHTML, like Gecko) Version/<BB Version #> Mobile Safari/<WebKit Version>

Related branches

Olivier Tilloy (osomon) on 2013-05-14
Changed in webbrowser-app:
importance: Undecided → High
status: New → Confirmed
description: updated
Pat McGowan (pat-mcgowan) wrote :

How about

Mozilla/5.0 (UbuntuTouch; Galaxy Nexus) AppleWebKit/534.46 (KHTML, like Gecko) Version/1.0 Mobile Safari/534.46

With the Webkit version reflecting what is actually included, and the device is taken from the environment

Changed in webbrowser-app:
assignee: nobody → Olivier Tilloy (osomon)
Pat McGowan (pat-mcgowan) wrote :

tested and that string is not sufficient, and BB10 seems to have the same issues with many sites.

Adnane Belmadiaf (daker) wrote :

I don't think this will work, using this UA will give you the desktop version on google/youtube/gmail because of most of the website are using the UA to decide which version to serve, here is my take :
Mozilla/5.0 (Ubuntu; Android 4.0.4; Ubuntu Touch build) AppleWebKit/534.46 (KHTML, like Gecko) Version/1.0 Mobile Safari/534.46

Adnane Belmadiaf (daker) wrote :

Well even with this UA some websites will display ads for there android apps ex: http://m.wolframalpha.com/ http://www.tvguide.co.uk

Adnane Belmadiaf (daker) wrote :

Something related to bug 1169758 some websites uses the javascript confirm box like this http://goo.gl/rRjKv and since it's not (yet) implemented the browser will assume that response is true and will redirect the user to the android market "market://details?id=..." ex: http://www.droidforums.net , this will result an unsable website.

Rasmus Eneman (pie-or-paj) wrote :

This one:
Mozilla/5.0 (MeeGo; Ubuntu; Mobile) AppleWebKit/534.46 (KHTML, like Gecko) Version/1.0 Mobile Safari/534.46
Is detected by http://detectmobilebrowsers.com as a mobile browser, I also tried Youtube, Stackoverflow and Twitter and all detected it as a mobile browser.

And as we are freeriding on MeeGo instead of Android or IOS the risk for an app popup is very low and sites that have cared for an MeeGo app is probably fast to update their checking so we are detected separately.

When browser is run on a tablet instead of a phone Mobile should be replaced with Tablet to make it easy for web developers to create separate interfaces for phone, tablet and desktop.

We should also push big sites to start accepting an UA without MeeGo so that we eventually can skip that.

Adnane Belmadiaf (daker) wrote :

Actually Firefox OS is using his own UA "Mozilla/5.0 (Mobile; rv:18.0) Gecko/18.0 Firefox/18.0" but they are sending custom UA for some specific websites to get the mobile version https://github.com/mozilla-b2g/gaia/blob/master/build/ua-override-prefs.js.

Alexander Sack (asac) wrote :

mobile mail.yahoo.com doesn't work at all with current useragent string used in todays image... it just hangs there and displays a spinner...

using Mozilla/5.0 (Android; Mobile; rv:13.0) Gecko/13.0 Firefox/13.0 makes yahoo mail work great.

Adolfo Jayme (fitojb) on 2013-07-09
Changed in webbrowser-app (Ubuntu):
status: New → Confirmed
importance: Undecided → High
Gerv (gerv-launchpad) wrote :

Hi everyone,

We at Mozilla have put a great deal of thought into our UAs for our mobile products, and have a reasonably good understanding of the trade-offs involved. Obviously your situation is different if you are building on WebKit, but we are very happy to share our experience and suggestions with whoever makes this decision. Drop me an email - <email address hidden> - if you are interested in that.

And it is a _big_ decision - because once you choose something, you are stuck with it. If you keep tweaking it, you'll break something every time you fix something, and it will get very frustrating. Getting this wrong could seriously affect the market acceptance of your product.

We'd love to have people from Ubuntu join us in our evangelism efforts to make the web more multi-browser friendly.

I would strongly recommend that you implement an override mechanism as a "safety valve" for sites which you can't persuade to fix themselves. It's not a magic bullet for compatibility problems, but it can help.

Gerv

Bill Filler (bfiller) wrote :

@gerv
Thanks for the comments! When you say override mechanism are you referring to something like this:
https://github.com/mozilla-b2g/gaia/blob/master/build/ua-override-prefs.js where you send a custom UA string for a certain set of sites? Seems like a good idea. Curious how that list maintained and if the process is manual or automated somehow.

Bill Filler (bfiller) wrote :

I can confirm that changing the UA string makes mobile.twitter.com work much better on Ubuntu Touch but couldn't find the right combination to make it work completely and look right. See bug https://bugs.launchpad.net/bugs/1190212

Setting UA String to any of these fixed the scrolling issue on the main list of tweets view:
 Mozilla/5.0 (Ubuntu like Android; Mobile; rv:13.0) Gecko/13.0 Firefox/13.0
 Mozilla/5.0 (Ubuntu; Android 4.0.4; Ubuntu Touch build) AppleWebKit/534.46 (KHTML, like Gecko) Version/1.0 Mobile Safari/534.46
 Mozilla/5.0 (Mobile; rv:18.0) Gecko/18.0 Firefox/18.0
However when clicking on a link in a tweet it wouldn't open.

Setting UA String to "", I could get all functionality working in twitter, including clicking a link opened the page in the new tab. The fonts looks bad and I had to manually go to mobile.twitter.com as it wasn't redirected automatically.

Alexander Sack (asac) wrote :

Hi Gerv,

My (personal) gut-reason tells me that your advice makes sense as that is what I roughly had in mind as well (but lacking hard data). Let us do some internal discussion first and get back to you!

Lawrence Mandel gave almost the same feedback on my blogpost here: http://asac.ws/post/54944482370/ubuntu-phone-ua-string-for-webbrowser-app

I assume he pointed you to this bug? Should we continue talking to you or him or both :)? In any case, great that you are still around and thanks for reaching out to us!

Adnane Belmadiaf (daker) wrote :

Hi Alex,

With the UA you provided you will get the old gmail/facebook apps.

Olivier Tilloy (osomon) wrote :

This is a good read on how to craft a default user-agent string: https://wiki.mozilla.org/Fennec/User_Agent.

Olivier Tilloy (osomon) wrote :

Documentation on the Boot2Gecko user-agent string: https://wiki.mozilla.org/B2G/User_Agent.

Bug report tracking the implementation of user-agent string overrides in B2G: https://bugzilla.mozilla.org/show_bug.cgi?id=782453.

Patch implementing user-agent string overrides in B2G: http://hg.mozilla.org/releases/mozilla-aurora/rev/45bfaa007dd0.

Olivier Tilloy (osomon) on 2013-08-13
Changed in webbrowser-app:
status: Confirmed → In Progress
PS Jenkins bot (ps-jenkins) wrote :

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

Changed in webbrowser-app:
status: In Progress → Fix Committed
Launchpad Janitor (janitor) wrote :

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

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

  [ Olivier Tilloy ]
  * Initial implementation of a user-agent string override mechanism,
    largely inspired by B2G’s implementation. (LP: #1190212, #1179596)

  [ Ubuntu daily release ]
  * Automatic snapshot from revision 284
 -- Ubuntu daily release <email address hidden> Tue, 20 Aug 2013 10:41:53 +0000

Changed in webbrowser-app (Ubuntu):
status: Confirmed → Fix Released
Olivier Tilloy (osomon) on 2013-09-03
Changed in webbrowser-app:
status: Fix Committed → Fix Released

Using webapp-container --user-agent-string with Firefox user-agent-string works:
$ webapp-container https://mail.google.com/mail/u/0/#inbox --app-id=comgooglemail --maximized --user-agent-string='Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:39.0) Gecko/20100101 Firefox/39.0'

To post a comment you must log in.
This report contains Public information  Edit
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.