Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'd like to know which User Agent string (UA) the Ubuntu Web Browser app on mobile devices has, and which implications does that have on existing web sites?

E.g. will most sites behave correctly with it? Is there some kind of fallback UA in case some web sites wouldn't work with it?

share|improve this question
    
Maybe these links are usefull for you: omgubuntu.co.uk/2013/11/… daker.me/2013/11/ubuntu-touch-user-agent.html –  Minos Nov 8 '13 at 10:46
add comment

3 Answers

up vote 4 down vote accepted

The current default UA string is of the following form:

Mozilla/5.0 (Ubuntu; <formFactor>) WebKit/<webkitVersion>

where <formFactor> is one of Mobile, Tablet or Desktop, and <webkitVersion> is the version of WebKit rendering engine (currently 537.21).

So on a phone, the current default UA string is:

Mozilla/5.0 (Ubuntu; Mobile) WebKit/537.21

This default UA string is deliberately short, the rationale is based on Mozilla’s B2G UA string research.

A number of websites and web applications are known not to play well with this default UA (web sites these days do a lot of crazily complicated server-side UA parsing to infer platform capabilities and serve customized content accordingly).

To overcome those issues, the Ubuntu Touch browser embeds an override mechanism that allows overriding the default UA for a given domain name (usually adding an Android token gets us the right content, although it often comes at the price of annoying prompts to install native android applications, which of course doesn’t apply to the platform). This mechanism is a short-term workaround. The proper long-term solution is evangelism, whereby users and developers get in touch with website authors to request that their pages and applications recognize our default UA string and serve adequate content.

Note that in a near future we’ll be switching from QtWebKit to Oxide (a thin layer on top of the Chromium Content API) for the rendering engine, meaning the rendering and capabilities will be virtually the same as Chrome’s. To reflect this and to enhance compatibility with existing websites, we will need to update the default UA string (it will be closer to Chrome’s default UA on devices).

share|improve this answer
add comment

The Ubuntu Touch UA is:
Mozilla/5.0 (Ubuntu; $FormFactor) WebKit/$WebKitRev
where the $FormFactor variable is "Mobile" OR "Tablet" and the $WebKitRev contains the WebKit engine's version. Also the major version "5.0" can change in the time.
Please note that a modern browser's UA can be changed by a plugin or by a simple reconfiguration; also you should know as a developer that the SEO don't like the content based on User Agent. If you need to recognize the User Agent don't do an exact match ("A"=="A") but do a substring search for the substrings Ubuntu AND (Mobile OR Tablet) to prevent compatibility problems with future versions of the mobile software.

Please note that the mobile browser of the Ubuntu Touch can change the UA in real-time to fix (obviously) some incompatibilities: another time, don't rely only on that mechanism.

Have a nice day,
let us know if you have more questions.


Source: daker.me

share|improve this answer
add comment

There is a simpler way to check the user-agent string sent by any browser. You can simply visit http://www.murl.mobi/headers.php and this page extracts and displays the HTTP request headers. A recent post on user-agent analysis using python gives a programmatic approach to analyze the actual user-agent string seen by a web-sever.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.