2020-06-18 10:59:51 -04:00
<!--
Title: How to use multiple compartmentalized Firefox instances simultaneously using profiles
Description: Learn how to use multiple compartmentalized Firefox instances simultaneously using profiles.
Author: Sun Knudsen < https: / / github . com / sunknudsen >
Contributors: Sun Knudsen < https: / / github . com / sunknudsen >
2020-09-10 10:07:07 -04:00
Reviewers:
2020-06-18 10:59:51 -04:00
Publication date: 2020-05-13T00:00:00.000Z
2020-11-10 07:13:35 -05:00
Listed: true
2020-06-18 10:59:51 -04:00
-->
# How to use multiple compartmentalized Firefox instances simultaneously using profiles
2021-02-11 17:44:27 -05:00
[](https://www.youtube.com/watch?v=Upib_vq_EB8 "How to use multiple compartmentalized Firefox instances using profiles")
2020-06-18 10:59:51 -04:00
2020-12-31 10:35:49 -05:00
## Guide
2020-08-10 19:35:31 -04:00
### Step 1: create Firefox profile
2020-06-18 10:59:51 -04:00
```shell
/Applications/Firefox.app/Contents/MacOS/firefox-bin -p
```
2021-01-04 13:43:06 -05:00
### Step 2: open “Script Editor” and paste following snippet
2020-06-18 10:59:51 -04:00
2021-11-27 11:20:35 -05:00
Replace `work` with profile name from [step 1 ](#step-1-create-firefox-profile ).
2021-01-04 13:43:06 -05:00
```
do shell script "nohup /Applications/Firefox.app/Contents/MacOS/firefox-bin -p \"work\" --no-remote > /dev/null 2>& 1 & "
```

### Step 3: export script as application
Click “File”, then “Export…”, set “Export As” filename to “Firefox work” (or any other filename), select “Applications” folder (in “Favorites”), select “Application” file format and click “Save”.

2021-01-08 09:17:03 -05:00
### Step 4: set Firefox app environment variable
2021-01-04 13:43:06 -05:00
2021-11-27 11:20:35 -05:00
Replace `Firefox work` with filename from [step 3 ](#step-3-export-script-as-application ).
2021-01-04 13:43:06 -05:00
```shell
2021-01-08 09:17:03 -05:00
FIREFOX_APP="Firefox work.app"
2021-01-04 13:43:06 -05:00
```
2021-01-08 09:17:03 -05:00
### Step 5: configure app as agent and set icon
2020-06-18 10:59:51 -04:00
```shell
2021-01-08 09:17:03 -05:00
defaults write "/Applications/$FIREFOX_APP/Contents/Info.plist" LSUIElement -bool yes
cp "/Applications/Firefox.app/Contents/Resources/firefox.icns" "/Applications/$FIREFOX_APP/Contents/Resources/applet.icns"
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -f "/Applications/$FIREFOX_APP"
2020-06-18 10:59:51 -04:00
```
2020-12-03 06:29:52 -05:00
👍