xpra icon
Bug tracker and wiki

Opened 3 months ago

Last modified 2 months ago

#1862 assigned enhancement

html5 client to support forwarding of url open requests

Reported by: Antoine Martin Owned by: Antoine Martin
Priority: major Milestone: 2.4
Component: html5 Version: 2.3.x
Keywords: Cc:

Description (last modified by Antoine Martin)

We can't just open a URL whenever we want because the browser's anti-popup feature will just block it.

So we would need to dock the request in the top bar (#1670) and the user can then click on it there.

Change History (3)

comment:1 Changed 3 months ago by Antoine Martin

Description: modified (diff)
Status: newassigned

comment:2 Changed 3 months ago by Antoine Martin

Basic support added in r19538: the URL shows up as a link in the top bar.

TODO:

  • add option on connect page
  • make it more noticeable? (animate it somehow?)
  • should make it look better and deal with long URLs (show just the hostname part?) - ideas welcome
  • hide the link once it has been clicked?
  • could automatically open the url on the next mouseup or keyup, meh - likely not the event that triggered the url request

comment:3 Changed 2 months ago by Matteo Ipri

I tried the beta version v2.4-r19555 on Ubuntu 17.10 artful.
It works as expected, thanks!
My comments:

  • Yes, it needs to be more noticeable. It is a real issue with fullscreen-ed apps, where the top bar is hidden below the app and thus it seems like nothing is happening.
  • I did not test very long URLs, but I think that a shortened URL should come with the possibility to inspect the whole URL before clicking on it, maybe with some sort of alter window or by hovering with the mouse over the shortened link.
  • Automatic link opening would be great, from a user experience standpoint, maybe toggable with an option.

With my colleague Andrea Succi, we found a solution for opening the links on clicks. You need to allow pop-ups, though.

We added this in Client.js, before the call to console.log():

    postMessage(url, "*");

And this in index.html, as last <head> item:

    <script >
       window.addEventListener('message',function(event) {	
       console.log('message received:  ' + event.data, event);	
       window.open(event.data, 'links-matlab');	
       },false);
    </script> 

If xpra HTML5 client is embedded in an iframe, the line in Client.js becomes:

    parent.postMessage(url, "*");

What do you think of this solution?

Note: See TracTickets for help on using tickets.