Open Bug 1653218 Opened 5 years ago Updated 5 years ago

Firefox with multiple profiles does not open urls from other apps

Categories

(Toolkit :: Startup and Profile System, defect)

78 Branch
defect

Tracking

()

UNCONFIRMED

People

(Reporter: admin, Unassigned)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Firefox/78.0

Steps to reproduce:

Start two firefox instances with different profiles via automator.app
Job 1:
/Applications/Firefox.app/Contents/MacOS/firefox-bin -P profile1 -no-remote &>/dev/null &

Job 2:
/Applications/Firefox.app/Contents/MacOS/firefox-bin -P profile2 -no-remote &>/dev/null &

Click any link from email message, for ex

Actual results:

Window choose user profile appears. Choosing a profile results an error firefox instance is already running

Expected results:

The link is opened in profile1 (worked on 10.14, broken on 10.15)

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Startup and Profile System
Product: Firefox → Toolkit

In the choose user profile window is the checkbox "Use the selected profile without asking at startup" checked? If not that would explain why you are seeing that dialog instead of Firefox just opening the link.

As for the "firefox instance is already running" message, this is correct. Passing -no-remote on the command line instructs Firefox to not listen for links opened from other applications. As a general rule you should not use -no-remote.

Flags: needinfo?(admin)

Without -no-remote FF just opens new empty window within instance profile1 without actually following the link
Also, all this mechanics was working before OS upgrade

Flags: needinfo?(admin)

Answering your first question - no, checkbox isn't checked. And it shouldn't be checked, because I need two FF instances with two profiles running concurrently

(In reply to admin from comment #4)

Answering your first question - no, checkbox isn't checked. And it shouldn't be checked, because I need two FF instances with two profiles running concurrently

If you're launching with -P then that checkbox doesn't matter but it matters for external links so since it is unchecked showing the profile chooser is the expected behaviour.

(In reply to admin from comment #3)

Without -no-remote FF just opens new empty window within instance profile1 without actually following the link
Also, all this mechanics was working before OS upgrade

Strange. Can you open the browser console (tools -> web developer -> browser console), click the trashcan icon in the top-left to clear any existing messages and then try opening a link from another app. If any new messages appear in the console paste them here.

Flags: needinfo?(admin)

Only this

OpenGL compositor Initialized Succesfully.
Version: 2.1 INTEL-14.6.18
Vendor: Intel Inc.
Renderer: Intel(R) Iris(TM) Plus Graphics OpenGL Engine
FBO Texture Target: TEXTURE_2D 
Flags: needinfo?(admin)

What happens if from a terminal you run /Applications/Firefox.app/Contents/MacOS/firefox-bin -P profile1 -url https://www.google.com ?

Flags: needinfo?(admin)

If there is a running instance on the profile, then error message is shown
If there is no running instance, FF opened with desired profile and google page is shown in separate tab

Flags: needinfo?(admin)

(In reply to admin from comment #8)

If there is a running instance on the profile, then error message is shown

Make sure the running instance wasn't run with -no-remote, if there is still an error message is it the "firefox instance is already running" message?

If there is no running instance, FF opened with desired profile and google page is shown in separate tab

No, there is not

Also, if instance is started without -no-remote tab with google is opened
But this is happened only for terminal command

This sounds like an OS related issue then. One thing to try would be to go into the general section of macOS system preferences and try changing your default browser to something else and then back to Firefox. That might reset the registration.

Does not help
Could you suggest, please, is there a way to change command been invoked by macos on url click?

My understanding is that it doesn't actually invoke a command if the app is already launched, it sends it some kind of message instead.

Maybe Steven has thoughts on what might be going on here.

Flags: needinfo?(spohl.mozilla.bugs)

(In reply to admin from comment #3)

Without -no-remote FF just opens new empty window within instance profile1 without actually following the link
Also, all this mechanics was working before OS upgrade

Can you double-check this? Is there possibly a new window and a new tab being opened, one with a blank page and one with the link from the other app?

Flags: needinfo?(spohl.mozilla.bugs) → needinfo?(admin)

No, only new window
But I opened browser console in the window, associated with another profile and I saw this

OpenGL compositor Initialized Succesfully.
Version: 2.1 INTEL-14.6.18
Vendor: Intel Inc.
Renderer: Intel(R) Iris(TM) Plus Graphics OpenGL Engine
FBO Texture Target: TEXTURE_2D
Error: Can't find profile directory. XULStore.jsm:66:15
    load resource://gre/modules/XULStore.jsm:66
    XULStore resource://gre/modules/XULStore.jsm:24
Flags: needinfo?(admin)

This one is profile2 window - the latest one been started

I would need to debug this to figure out why an OS upgrade would trigger this change in behavior. :mossop is right that this is typically handled via Apple Events and we do use some undocumented APIs, which have the potential to change between OS versions. Unfortunately, I can't promise that I will have the bandwidth to debug this in the near term. I would start by looking at https://searchfox.org/mozilla-central/source/toolkit/xre/MacApplicationDelegate.mm

Yeah, it's broken, but not totally broken
If I start firefox from application finder it opens profile chooser window. And this window can receive urls via messages (from other apps, automator scripts and so on). Secondary profile may be started with automator command, but it will never receive anything.

If first firefox instance is started with automator (or from shell), it receives a message, but opens a new blank window, no errors in browser console

The severity field is not set for this bug.
:mossop, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(dtownsend)
Severity: -- → S4
Flags: needinfo?(dtownsend)

For now I can't open two firefox instances on two different profiles at all
Second profile is always opened empty and does not work at all

You need to log in before you can comment on or make changes to this bug.