0

How would i programmatically determine the profile that firefox is using when it is launched. I need to be able to do this from my OSX application. I receive a notification that firefox is opened. If I know the profile being used, I can determine if our firefox extension has been installed for that user profile.

I have looked at profile.ini and install.ini. But neither gives me an indication as to the current profile being used.

Nickolay
  • 28,261
  • 8
  • 94
  • 160

1 Answers1

0

The only way that comes to mind is to look which files Firefox hold open. From the shell:

pgrep firefox | xargs -I{} lsof -p {} | grep .parentlock | \
   awk '{for(i=9;i<=NF;++i)printf $i""FS ; print ""}'  # https://stackoverflow.com/questions/1602035/how-to-print-third-column-to-last-column#comment79559682_1602063

But if you have an extension installed, a more robust way might be to have it announce what profile it's installed in.

Nickolay
  • 28,261
  • 8
  • 94
  • 160