xdg-open – Opening a URL with xdg-open Using Mozilla Remote Protocol

freedesktopxdg-open

Older versions of Netscape and Mozilla (for X11) supported the so-called remote protocol: it was possible to open a URL or start composing an e-mail whenever a Netscape/Mozilla window (not necessarily from a local process) was open on the current DISPLAY.

The "remote" feature worked either way: either from a remote client to a local browser, or vice versa, or even from a remote host1 to a remote host2, provided both could connect to the local DISPLAY.

Here's the documentation for:

Rudimentary support for remote requests has been preserved in SeaMonkey, too, so even nowadays it supports arguments like openURL(%url%,new-tab) and openURL(%url%,new-window)

Now, I want to create a custom *desktop file which would launch SeaMonkey with exactly those arguments.

The problem is, in this form:

[Desktop Entry]
Exec=seamonkey %u

%u expansion works, while in this one:

[Desktop Entry]
Exec=seamonkey -remote openURL(%u)

it doesn't: %u gets expanded only if it's surrounded with spaces.

The desktop entry specification doesn't mention this, so this is both an undocumented and unexpected behaviour.

Can you suggest any workaround?

Best Answer

I cannot say anything about the specification but as far as just the result matters I (not being familiar with the quoting in such files, though) would expect this to work:

Exec=bash -c 'echo seamonkey openURL"($1)"' seamonkey-wrapper %u%
Related Question