Join us and the lead editor of IRL, Mozilla's multi-award-winning podcast, for a behind-the-scenes look at the pod and to contribute your ideas for the next season, themed: "AI and ME." Mark your calendar and join our Community Call on Wednesday, Aug 7, 17:00–17:45 UTC. See you there!

Sykje yn Support

Mij stipescams. Wy sille jo nea freegje in telefoannûmer te beljen, der in sms nei ta te stjoeren of persoanlike gegevens te dielen. Meld fertochte aktiviteit mei de opsje ‘Misbrûk melde’.

Mear ynfo

Dizze konversaasje is argivearre. Stel in nije fraach as jo help nedich hawwe.

Mac OS: How do I target a specific instance of Firefox from the command line when more than one instance is running?

  • 1 antwurd
  • 2 hawwe dit probleem
  • 14 werjeftes
  • Lêste antwurd fan firefox.com14

more options

I use different instance of FF with different profiles as front ends for specific php applications. Sometimes when I launch a new instance via the backend script of a GUI app I've created, even though the command line arguments for the firefox binary specify the url, the instance sometimes fails to open the url and stays at the default home page. I'd like to avoid having to set the target url in the preferences for the FF profile and instead load it from the command line, as I set the url in a config file for my GUI app and don't want to have it set in multiple places.

Obviously I can get the PID of the instance, but then how would I use that (or the firefox binary) to tell that instance to open a specific URL?

Code from the script that launches FF: (included variable are defined previously)

   browserlaunchcmd="$browserdir/Firefox.app/Contents/MacOS/firefox -P $browserprofile -no-remote \"http://$webdomain/\""
   ...
   eval "$browserlaunchcmd"
I use different instance of FF with different profiles as front ends for specific php applications. Sometimes when I launch a new instance via the backend script of a GUI app I've created, even though the command line arguments for the firefox binary specify the url, the instance sometimes fails to open the url and stays at the default home page. I'd like to avoid having to set the target url in the preferences for the FF profile and instead load it from the command line, as I set the url in a config file for my GUI app and don't want to have it set in multiple places. Obviously I can get the PID of the instance, but then how would I use that (or the firefox binary) to tell that instance to open a specific URL? Code from the script that launches FF: (included variable are defined previously) browserlaunchcmd="$browserdir/Firefox.app/Contents/MacOS/firefox -P $browserprofile -no-remote \"http://$webdomain/\"" ... eval "$browserlaunchcmd"

Alle antwurden (1)

more options

I've figured a workaround for the url not loading on launch, but still haven't figured an answer to the targeting question.

The workaround is to echo

   user_pref('browser.startup.homepage', '[STARTUP URL]');

to the file "user.js" in the profile directory prior to issuing the FF launch command (or else check if that file with that line already exists in that folder). Coarse, but it works, and allows the URL to be set via the variable in the App's config file without duplication.

Bewurke troch firefox.com14 op