← Back to team overview

ubuntu-phone team mailing list archive

Re: Webapp developers - Container switch to using Oxide *only*

 

Le 30/05/2014 16:45, Olivier Tilloy a écrit :
On Fri, May 30, 2014 at 4:31 PM, Sam Bull <sam.hacking@xxxxxxxx> wrote:

On ven, 2014-05-30 at 14:49 +0200, David Barth wrote:
The webapp-container has switched to Oxide for a few months and the
feedback is generally very good. Oxide is performing much better, with a
score close to 500 on the html5test scale.
I get a score of 503. That's impressive work, it appears to be the
highest scoring mobile browser listed, and only 4 points behind the top
desktop browser. Unfortunately, it seems to think I'm using Chromium 35
on Android 4.4, which doesn't help in adding Ubuntu to the list of
browser comparisons.

On mobile, the default UA is:

      Mozilla/5.0 (Linux; Ubuntu 14.04 like Android 4.4) AppleWebKit/537.36
Chromium/35.0.1870.2 Mobile Safari/537.36

A large number of websites/webapps make crazy assumptions about the user
agent to serve the right content, so we had to compromise on simplicity and
cleanliness by including the Android, AppleWebKit and Safari tokens in the
default UA.

Note that there is a UA override mechanism that allows sending an custom UA
string based on domain and form factor, if the default one is not good
enough. I guess such a custom UA could be used for test/benchmarking sites,
to ensure the browser app is correctly identified as Ubuntu.
Ahem, our messages crossed obviously ;) But on that override mechanism, you can take a look at this branch to see an example of how it works:

http://bazaar.launchpad.net/~dbarth/+junk/webapp-whichbrowser/view/head:/app.desktop#L6 <http://bazaar.launchpad.net/%7Edbarth/+junk/webapp-whichbrowser/view/head:/app.desktop#L6>

You need the --local-webapp-manifest and the --webapp option as well. The latter is temporary and takes a base64 encoded website name. We will drop that last requirement asap.

The parameter file itself is a small subset of what we had for desktop webapps. Mostly you need the 4 parameters here: http://bazaar.launchpad.net/~dbarth/+junk/webapp-whichbrowser/view/head:/webapp-properties.json <http://bazaar.launchpad.net/%7Edbarth/+junk/webapp-whichbrowser/view/head:/webapp-properties.json>, including the "user-agent-override" variable which will do what it says.

David


References