is palemoon -remote supported ?

Support and discussions for the x86/x64 Linux version of Pale Moon.

Moderators: trava90, satrow

Lucio Chiappetti
Fanatic
Fanatic
Posts: 232
Joined: Mon, 01 Sep 2014, 15:11
Location: Milan Italy

is palemoon -remote supported ?

Unread postby Lucio Chiappetti » Tue, 23 Oct 2018, 12:57

I have a wrapper script invoked by my mail user agent which should display an URL contained in a mail message in a new palemoon tab. It used to work with PM 25, but it is not listed in palemoon -help for PM 28. In a nutshell the wrapper did a test whether PM is running (which usually is), if so loads the URL in "remote", if not fires a browser and exits

Code: Select all

palemoon -remote "ping()" >& /dev/null
if ( $status == 0) then
    palemoon -remote "openURL($1)"
else
    (palemoon $1) &
endif


Apparently palemoon -remote is not documented, it works in openURL but not in ping mode. What is the proper replacement syntax for the above behaviour ?
The reasonable man adapts himself to the world: the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. (G.B. Shaw)

vannilla
Fanatic
Fanatic
Posts: 158
Joined: Sat, 05 May 2018, 13:29

Re: is palemoon -remote supported ?

Unread postby vannilla » Tue, 23 Oct 2018, 14:21

Maybe you could grep for the browser in the output of "ps -e"?

Code: Select all

ps -e | grep palemoon > /dev/null
if [[ "$?" == "0" ]]; then
    palemoon -remote "openURL($1)"
else
    palemoon $1 &
fi


This is for bash, adapt it to whatever shell you are using.

Edit:
Sorry, completely misread part of your post, so my answer isn't actually that helpful. Still, the solution is valid if you can run ps, etc. so I'm leaving it here.
Last edited by vannilla on Tue, 23 Oct 2018, 14:23, edited 1 time in total.

Lucio Chiappetti
Fanatic
Fanatic
Posts: 232
Joined: Mon, 01 Sep 2014, 15:11
Location: Milan Italy

Re: is palemoon -remote supported ?

Unread postby Lucio Chiappetti » Tue, 23 Oct 2018, 14:37

Of course the solution is valid, though less elegant than -remote ping().
My question is actually twofold, i.e. whether -remote ping() is still a valid syntax or has a replacement, and whether -remote in general is still necessary or now redundant.

I am trying to debug the invocation of palemoon from my MUA after a general system upgrade
The reasonable man adapts himself to the world: the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. (G.B. Shaw)

Walter Dnes
Astronaut
Astronaut
Posts: 569
Joined: Thu, 30 Jul 2015, 20:29
Location: Vaughan, ON, Canada

Re: is palemoon -remote supported ?

Unread postby Walter Dnes » Tue, 23 Oct 2018, 21:03

I believe that --remote is the default, and not even listed as an option. You have to use --no-remote to disable it. I think your problem is that openURL does not appear to be supported, let alone required.

palemoon "openURL(https://www.youtube.com)" & fails

palemoon "https://www.youtube.com" & works

You probably want palemoon "$1" & in your script.
There's a right way
There's a wrong way
And then there's my way

vannilla
Fanatic
Fanatic
Posts: 158
Joined: Sat, 05 May 2018, 13:29

Re: is palemoon -remote supported ?

Unread postby vannilla » Tue, 23 Oct 2018, 22:21

I experimented a couple of times, out of curiosity.
Running

Code: Select all

palemoon -remote "ping()"
returns immediately with $? equal to 1.

Code: Select all

palemoon -remote "openURL(http://gentoo.org)
hanged for a bit, then opened the Gentoo website in my running instance (note that I used http, not https, though it probably simply redirected me).
MDN lists -remote as a valid (but deprecated) option, but doesn't list the commands or anything useful.

Walter Dnes
Astronaut
Astronaut
Posts: 569
Joined: Thu, 30 Jul 2015, 20:29
Location: Vaughan, ON, Canada

Re: is palemoon -remote supported ?

Unread postby Walter Dnes » Wed, 24 Oct 2018, 11:12

What's the difference between the two commands to justify the extra keystrokes in the first version?

Code: Select all

palemoon -remote "openURL(http://gentoo.org)" &
palemoon "http://gentoo.org" &
There's a right way
There's a wrong way
And then there's my way

Lucio Chiappetti
Fanatic
Fanatic
Posts: 232
Joined: Mon, 01 Sep 2014, 15:11
Location: Milan Italy

Re: is palemoon -remote supported ?

Unread postby Lucio Chiappetti » Wed, 24 Oct 2018, 12:45

The commands were derived from an earlier version of palemoon, in turn derived from an earlier version of firefox, in turn probably from an even earlier version of mozilla or netscape. At the time is was important (or deemed so in the instructions of my MUA) to proceed as follows:

if a browser is already running (-remote ping returns zero) then open url in new tab of existing browser instance (-remote openUrl)
else start the browser afresh

Now I must admit that I usually have the browser permanently running, but I kept the scripts for backward compatibility
The reasonable man adapts himself to the world: the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. (G.B. Shaw)

vannilla
Fanatic
Fanatic
Posts: 158
Joined: Sat, 05 May 2018, 13:29

Re: is palemoon -remote supported ?

Unread postby vannilla » Wed, 24 Oct 2018, 15:50

Walter Dnes wrote:What's the difference between the two commands to justify the extra keystrokes in the first version?

Code: Select all

palemoon -remote "openURL(http://gentoo.org)" &
palemoon "http://gentoo.org" &

MDN says that -remote works only under the X Window System, so it's likely something left over from something using some parts of the X protocol, then removed.
Anyway, looking at the browser's code through xref, it seems that "ping" isn't a supported command.
What's defined is: "openurl", "openfile" (which is an alias for openurl) and "xfedocommand(openbrowser)" (written that way), which seems to simply open a new window.


Return to “Pale Moon for Linux”

Who is online

Users browsing this forum: No registered users and 6 guests