← Back to team overview

ubuntu-phone team mailing list archive

Re: [Development] Override user agent string in WebApp

 

On Fri, Aug 14, 2015 at 11:48 AM, Peter Bittner <peter.bittner@xxxxxxx>
wrote:

> Thank you, David, for the elaborate explanation.
>
> Just for curiosity's sake, can you explain why desktop notification work
> with Web browsers and the Ubuntu desktop, without any server-side control
> from our side? (e.g web.skype.com will show an OSD for incoming messages)
>
> Is this all just because the browser tab is contiuously polled for
> changes? It's not websockets that plays their part, is it?
>

The tab is always active in that case. Which means that if the server
pushes the notification to the client, via the websocket kept open, then it
will be extracted by the JS code that runs in the tab, and displayed to the
user.
But if you have that same JS code running in webapp-container, that socket
can't be read while the webapp is in the backaground, because it is
suspended; the javascript code does not run. So it has no way of extracting
the notification, nor put it in a system notification.


> Is an OSD desktop notification of a website eqivalent to a WebApp always
> being active? So, the WebApp would show an integrated platform notification
> of Ubuntu Touch?
>

An OSD desktop notification is only created once the JS code running in the
tab receives the notification, if I understand your scenario. There are 2
distinct components here, that just work together. In all cases, webapps,
as other normal applications should use integrated platform notifications,
just to make it consistent for the user.

David

References