open url in specific running profile instance

The place to report Pale Moon specific bugs on Linux and other operating systems.

Moderator: satrow

User avatar
50addons
Apollo supporter
Apollo supporter
Posts: 46
Joined: Sat, 09 Jun 2018, 11:43
Location: 56.5°N

open url in specific running profile instance

Unread postby 50addons » Sat, 09 Jun 2018, 22:22

set-up: multiple Palemoon processes are running using different profiles.

objective: open a url in a specific process from the command-line.

problem: depending on the command-line options, the url is either opened in the wrong process or the attempt fails with an error message.


Steps to Reproduce:
create two profiles p1 and p2

Test 1

launch two instances using different profiles:

Code: Select all

palemoon -P p1 -new-instance
palemoon -P p2 -new-instance


open second url in both profile instances:

Code: Select all

palemoon -P p1 -new-tab <url>
palemoon -P p2 -new-tab <url>


Result:
Two processes are launched by the first set of commands (correct behaviour).
Further urls are always opened in the process which was launched first (in this case p1). The profile parameter is ignored.

Test 2

launch one instance using a specific profile:

Code: Select all

palemoon -P p1 -no-remote


open second url in profile instance:

Code: Select all

palemoon -P p1 -new-tab <url>
palemoon -P p1 -remote "openurl(<url>,new-tab)"


Result:
Connecting to a process previously launched with -no-remote always fails:
  • Opening the second url using -new-tab produces error: "Pale Moon is already running, but is not responding. To open a new window, you must first close the existing Pale Moon process, or restart your system."
  • Opening the second url using -remote produces error: "Error: No running window found"


Test 3

launch one instance using a specific profile:

Code: Select all

palemoon -P p1 -new-instance


open second url in profile instance:

Code: Select all

palemoon -P p1 -remote "openurl(<url>,new-tab)"


Result:
Opening the second url using -remote always produces this error regardless with which parameters the process was originally launched: "Error: No running window found"

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 22313
Joined: Sun, 28 Aug 2011, 17:27
Location: 58.5°N 15.5°E
Contact:

Re: open url in specific running profile instance

Unread postby Moonchild » Sun, 10 Jun 2018, 00:36

This is not a bug.

The situation is this:
  • You can only open URLs in a running browser if it has remote capabilities enabled.
  • You can only have multiple concurrent profiles open if you disable remote capabilities.
  • You cannot have multiple instances open with remote capabilities because they would conflict in their system type handlers (same application+same type).

So either you have 1 browser instance with remote capabilities enabled, in which case launched URLs will -always- open in that instance, or you have all browsers launched without remote capabilities in which case it will throw an error because no active application is available to handle the request.
Improving Mozilla code: You know you're on the right track with code changes when you spend the majority of your time deleting code.

"If you want to build a better world for yourself, you have to be willing to build one for everybody." -- Coyote Osborne

Take note: 23 November is Wolfenoot! Eat roast meat and/or cake decorated like the full moon. #wolfenoot

User avatar
50addons
Apollo supporter
Apollo supporter
Posts: 46
Joined: Sat, 09 Jun 2018, 11:43
Location: 56.5°N

Re: open url in specific running profile instance

Unread postby 50addons » Sun, 10 Jun 2018, 08:59

If this is not a bug, then my post is a feature request.

I don't know which Firefox version Palemoon was forked from but the remote capability for concurrent browser profiles has been a Firefox feature since before version 0.9.
In the old days remote url launch was via

Code: Select all

-P <profile> -remote "openurl($url,new-tab)"


Later Firefox introduced the -new-instance parameter, which creates a new Linux process for a profile, which is remote enabled. You can have only one process per profile. An attempt to open a second instance for that profile results in error "Firefox is already running, but is not responding. ...".
Remote acccess to open a second tab or window is via

Code: Select all

-P <profile> -new-tab <url>

Firefox 45 ESR implies remote capability when launching a new profile instance. Further tabs from outside the browser have to be opened via -new-tab or -new-window.

This Firefox feature was broken for a while from v.0.9 onwards when they introduced -a application-id for process identification (ditched later). At that point the behaviour and error messages were the same as Palemoon's current functionality, hence I thought this was a Palemoon bug (see bugzilla 427206, bugzilla 716110 and bugzilla 393645).

Usage: I use this hundreds of times a day to open links in a specific profile from my email and rss clients or in Firefox to open a link or tab url in a different profile using the OpenWith add-on.
Last edited by 50addons on Sun, 10 Jun 2018, 09:11, edited 1 time in total.
Good-bye Firefox.

User avatar
therube
Astronaut
Astronaut
Posts: 639
Joined: Fri, 08 Jun 2018, 17:02

Re: open url in specific running profile instance

Unread postby therube » Tue, 12 Jun 2018, 05:16

(i'll just babble...)

pretty sure Windows / Linux are different regarding this
at some point the meaning of -no-remote changed & or -new-instance created, intertwined, split apart
i've only ever used -no-remote
(i'm on Windows)

(using FF 60, because it was close by...)
i can:
firefox -profile p1 -new-instance
firefox -profile p2 -new-instance
it successfully creates/opens/loads p1 & p2
& that implies, at least in Windows, that -new-instance also is invoking -no-remote

after that, i was not successful in using anything like:
firefox -profile p1 -new-tab <url>
firefox -profile p2 -new-tab <url>
instead each time <url> opened in my non-no-remote (i.e. remoted) instance of FF
firefox -profile p1 -remote "openurl(<url>,new-tab)"
also failed, not sure just where that might have gone, but i suspect a place like /dev/nul

User avatar
50addons
Apollo supporter
Apollo supporter
Posts: 46
Joined: Sat, 09 Jun 2018, 11:43
Location: 56.5°N

Re: open url in specific running profile instance

Unread postby 50addons » Wed, 13 Jun 2018, 23:16

@therube:

I have been using Firefox since 2006 on Linux, no experience with Windows versions. In that time I have only upgraded five times (versions 2.0, 3.0, 3.5, 24.0, 45ESR).
In every version I had the concurrent remotable profile functionality, which I find essential, so much so that I downloaded and patched the source whenever the feature was broken in Firefox' version history, typically when commandline parameters were introduced or modified.

The original implementation of the feature was via the -remote parameter:

Code: Select all

firefox -P <profile> -no-remote // first instance
firefox -P <profile> -remote "openurl (<url>,new-tab)" // further instances


The functionality was broken from version 2.0 through to 3.5, probably due to introduction of -new-instance. According to Wikipedia, the first PaleMoon version was based on Firefox 3.5.2, so would have been without concurrent remotable profile functionality.

By Firefox 24.0, the bug had been fixed, but -no-remote semantics changed and its former functionality replaced by -new-instance:

Code: Select all

firefox -P <profile> -new-instance // first instance
firefox -P <profile> -remote "openurl (<url>,new-tab)" // further instances

If PaleMoon 24.0 was a full port of Firefox 24.0, this functionality would have been present.

The -remote option was removed in Firefox 36.0, reintroduced in 36.0.1 and retired from Firefox 39.0; After that the functionality continued to be available via this simplified commandline syntax:

Code: Select all

firefox -P <profile> -new-instance // first instance
firefox -P <profile> -new-tab<url>" // further instances

This worked at least until version 45ESR.

I have no idea what the state of play was in Firefox 38.0, which, according to Wikipedia, PaleMoon 27 is based on.
At least in Firefox, whenever remotable profiles weren't working, it was a bug, not by design.
Good-bye Firefox.


Return to “Bug reports (Linux & other)”

Who is online

Users browsing this forum: No registered users and 2 guests