← Back to team overview

ubuntu-phone team mailing list archive

Re: Webapp Question & Nexus Calls

 

On Fri, Aug 22, 2014 at 1:32 PM, Mitchell Reese <
projects@xxxxxxxxxxxxxxxxxxxxx> wrote:

> Thanks Olivier, that last might be the way to go. I've created several
> webapps of sites I use daily - Australian banks, news, online arts journal,
> etc.
> I won't have any control of the content in these apps - I'm just creating
> something to easily view them. Unfortunately, mobile banking sites opened
> on a desktop web browser still end up being mobile banking sites - they
> suck. Will have a play with the link to the QML code below, and see what I
> come up with. As webapps seem to be such a big part of the Ubuntu user
> story, it would be great to have some easily definable way to choose a
> mobile site or desktop site, based on the end-users device.
>

If you are sure that regardless of the UA, requesting foobar.com (desktop
site) always renders desktop content and requesting m.foobar.com (mobile
site) always renders mobile content, and that one won’t automagically
redirect to the other (and/or vice versa), then you could set the WebView’s
url to one or the other conditionally, instead of messing around with UA
strings.

Automatically deciding on what kind of content to request based on the
device is tricky and error-prone. What about 7" tablets? Do they qualify
for desktop or mobile content?
The proper solution to that problem is that website authors start using
dynamic layouts more, and get rid of that really bad habit of serving
different content based on UA string parsing. It won’t happen overnight
though.

HTH,

 Olivier

References