Webapp-container: selection upon long press is not always desirable

Bug #1373773 reported by Daniel Beck
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
webbrowser-app (Ubuntu)
Invalid
Low
Unassigned

Bug Description

HTML5 applications can be packed as "webapp-container". The idea is to make them look "nativ".

However, when I user Iong presses a DOM element, a white border appears around the DOM element and a contextual popup menus opens, giving the user the option to copy the text from the DOM element.

This shouldn't happen.

I do start the app as follows: (.desktop file)
Exec=webapp-container --store-session-cookies --webappUrlPatterns=https?://greenmahjong.daniel-beck.org/* http://greenmahjong.daniel-beck.org %u

Revision history for this message
Olivier Tilloy (osomon) wrote :

The fact that the webapp container exposes a default contextual menu is intended. It’s unfortunate that it doesn’t expose a command-line option to optionally disable it though.

You have a couple of options there:
 1) Ensure your web application doesn’t emit "contextmenu" DOM events (this is what the selection mechanism uses), i.e. if it swallows them they will never reach the container
 2) Instead of using the webapp container, build a simple QML application that embeds a WebView (import it from Ubuntu.Web), which by default has the selection mechanism disabled

I’ll leave this bug open so we can consider adding a command-line option to the webapp-container app to optionally disable the selection.

summary: - Webapp-container: long press opens contextual menu
+ Webapp-container: selection upon long press is not always desirable
affects: oxide → webbrowser-app
Revision history for this message
David Barth (dbarth) wrote : Re: [Ubuntu-webapps-bugs] [Bug 1373773] Re: Webapp-container: long press opens contextual menu

It is an interesting use case for webapp-container. You are at the limit of
where you'd want to have your own container to drive the app, yet you don't
require local system access apart from what the W3C APIs already provide.

I would tend to prefer not to add the option, and recommend you use one of
the 2 options Olivier proposed.
The rationale being that webapp-container is mostly a container for
existing web sites which expect a "browser" environment, albeit with
limited chrome. In your case, you are a genuine HTML5 App, delivered
online, but which wants to drive all of its UI outside of a regular browser
context.

On Thu, Sep 25, 2014 at 11:58 AM, Olivier Tilloy <
<email address hidden>> wrote:

> The fact that the webapp container exposes a default contextual menu is
> intended. It’s unfortunate that it doesn’t expose a command-line option
> to optionally disable it though.
>
> You have a couple of options there:
> 1) Ensure your web application doesn’t emit "contextmenu" DOM events
> (this is what the selection mechanism uses), i.e. if it swallows them they
> will never reach the container
> 2) Instead of using the webapp container, build a simple QML application
> that embeds a WebView (import it from Ubuntu.Web), which by default has the
> selection mechanism disabled
>
> I’ll leave this bug open so we can consider adding a command-line option
> to the webapp-container app to optionally disable the selection.
>
> ** Summary changed:
>
> - Webapp-container: long press opens contextual menu
> + Webapp-container: selection upon long press is not always desirable
>
> ** Project changed: oxide => webbrowser-app
>
> --
> You received this bug notification because you are a member of Ubuntu
> WebApps bug tracking, which is subscribed to webbrowser-app.
> https://bugs.launchpad.net/bugs/1373773
>
> Title:
> Webapp-container: selection upon long press is not always desirable
>
> Status in Web Browser App:
> New
>
> Bug description:
> HTML5 applications can be packed as "webapp-container". The idea is to
> make them look "nativ".
>
> However, when I user Iong presses a DOM element, a white border
> appears around the DOM element and a contextual popup menus opens,
> giving the user the option to copy the text from the DOM element.
>
> This shouldn't happen.
>
> I do start the app as follows: (.desktop file)
> Exec=webapp-container --store-session-cookies
> --webappUrlPatterns=https?://greenmahjong.daniel-beck.org/*
> http://greenmahjong.daniel-beck.org %u
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/webbrowser-app/+bug/1373773/+subscriptions
>
> --
> Mailing list: https://launchpad.net/~ubuntu-webapps-bugs
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~ubuntu-webapps-bugs
> More help : https://help.launchpad.net/ListHelp
>

David Barth (dbarth)
Changed in webbrowser-app:
importance: Undecided → Low
status: New → Triaged
assignee: nobody → Alexandre Abreu (abreu-alexandre)
Revision history for this message
Daniel Beck (d-danielbeck) wrote :

I just checked the game in a newer ubuntu touch release (r243). The context menu doesn't appear anymore. However, according to this bug report, the context menu is intended. Should I fill a new bug?

Revision history for this message
Olivier Tilloy (osomon) wrote :

Just tested on image #270 (on nexus 7), and the selection and contextual menu still appears when long pressing on the game board.

Olivier Tilloy (osomon)
Changed in webbrowser-app (Ubuntu):
status: New → Triaged
importance: Undecided → Low
assignee: nobody → Alexandre Abreu (abreu-alexandre)
no longer affects: webbrowser-app
Revision history for this message
Olivier Tilloy (osomon) wrote :

This is not valid any longer as the touch selection mechanism has been removed from the browser and webapp container, and will soon be replaced by a proper text selection UI (see bug #1376268).

Changed in webbrowser-app (Ubuntu):
status: Triaged → Invalid
assignee: Alexandre Abreu (abreu-alexandre) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.