xpra icon
Bug tracker and wiki

Opened 10 months ago

Closed 10 months ago

Last modified 5 months ago

#1726 closed enhancement (fixed)

intercept xdg-open and forward it to the client

Reported by: Antoine Martin Owned by: J. Max Mena
Priority: major Milestone: 2.3
Component: core Version: 2.2.x
Keywords: Cc:

Description

This could be enabled by default when we add at least a dialog showing that the file is ready to be opened (see #1375) since we don't want open-silently by default. (for security reasons)

  • forwarding of files can re-use the "send-file" protocol: wiki/FileTransfers
  • for urls we will need a new protocol message

Maybe each one could be enabled independently?

Attachments (1)

xdg-open-url.patch (27.5 KB) - added by Antoine Martin 10 months ago.
forwarding of xdg-open for URLs

Download all attachments as: .zip

Change History (5)

comment:1 Changed 10 months ago by Antoine Martin

Status: newassigned

Basic support added in r17726.

xdg-open /some/file

Will end up sending the file to the client and ask it to open it. (which is not allowed by default)

Changed 10 months ago by Antoine Martin

Attachment: xdg-open-url.patch added

forwarding of xdg-open for URLs

comment:2 Changed 10 months ago by Antoine Martin

Owner: changed from Antoine Martin to J. Max Mena
Status: assignednew

Done in:

  • r17740: add prompt for accepting file-transfer/file-open (#1375)
  • r17742: packaging of xdg-open override script
  • r17743: support url-open with prompt
  • r17744 + r17745: enable forward-xdg-open by default
  • r17752: also redirect gnome-open and gvfs-open

Things that could be done to improve this:

  • improve the popup dialog: #1375
  • requires a unix-domain socket that does not require authentication, and we pass the socket path using an env var which is a bit iffy
  • forward-xdg-open could support url, paths as options to only forward the type specified and let the other one through - meh

Notes:

  • this only works from an environment we setup (we modify $PATH), so commands started with --start=xterm (or --start-child and friends), but not with DISPLAY=:N xterm
  • some applications will bypass xdg-open, maybe we need to override xdg-mime for those? (PITA as this points to a desktop file..) - see Where does firefox get the “default” applications for opening files from? (esp comments: gnome-open, gvfs-open, gio open - some kind of sick joke?)
  • more improvements recorded in ticket:1375#comment:7

How to test:

  • start server with forward-xdg-open=no then xdg-open works normally (not overriden with our custom script)

From here on, with forward-xdg-open=yes (which is the default):

  • in an xterm, run xdg-open https://xpra.org/, this should popup the dialog asking the client if it accepts to open this URL
  • change the client's command line: set --open-url to no or yes, and check again
  • for file-transfers, test with xdg-open /path/to/some/file.png, again, the dialog should come up
  • and again, change --file-transfer to no or yes and check again (default value is ask)

@maxmylyn: just a FYI.

Last edited 5 months ago by Antoine Martin (previous) (diff)

comment:3 Changed 10 months ago by J. Max Mena

Resolution: fixed
Status: newclosed

Noted and closing.

Last edited 5 months ago by Antoine Martin (previous) (diff)

comment:4 Changed 5 months ago by Antoine Martin

For the html5 client, see #1862.

Note: See TracTickets for help on using tickets.