by: Helge, published: Jan 28, 2020, updated: Mar 10, 2020, in

Firefox Containers: Multiple (Gmail) Logins Through Privacy Isolation

To monitor web app performance and usage on any site (or just on your business-critical SaaS apps), take a look at our uberAgent product.

In a nutshell, Firefox Containers makes it possible to log in to a website with multiple different accounts at the same time. This is accomplished through data segmentation: cookies and other site data stay within the boundaries of a container.

Firefox Containers work with any web or SaaS app, but they are especially useful where you frequently need to switch identities. One example is a consultant accessing Azure Portal for different customers; another is … Gmail.

Multiple Gmail Accounts

Gmail is remarkably bad at handling multiple simultaneous logins. Sure, you can log in to multiple Google accounts and switch accounts in the upper right corner of the Gmail UI. You can also open multiple Gmail tabs, one per account. This approach leaves several things to be desired, though:

  • There is no visual indicator, i.e., a tab’s icon does not show which which Gmail account it hosts
  • You can’t bookmark specific Gmail accounts, e.g. “Work Gmail”
  • Gmail accounts may get mixed up when you need to reauthenticate

Root Cause

When you open multiple Gmail accounts in different tabs, Gmail adds a number to the URL to differentiate between accounts. In the example below, the account number is “2”:

https://mail.google.com/mail/u/2/#inbox

The main problem is that these numbers are assigned in the order that you log on to Google accounts. The numbers are not tied to the actual accounts in any way. When Google asks you to reauthenticate, it is quite likely that you follow a different sequence. And voilà, the tab that used to show your work Gmail account now hosts your personal account and vice versa.

Let’s illustrate this with an example.

Original Tabs and Accounts

  • Tab 1: https://mail.google.com/mail/u/0/#inbox, work
  • Tab 2: https://mail.google.com/mail/u/1/#inbox, personal
  • Tab 3: https://mail.google.com/mail/u/2/#inbox, sports club

Tabs and Accounts After Reauthentication

  • Tab 1: https://mail.google.com/mail/u/0/#inbox, personal
  • Tab 2: https://mail.google.com/mail/u/1/#inbox, sports club
  • Tab 3: https://mail.google.com/mail/u/2/#inbox, work

Gmail: No Bookmarking of Invididual Accounts

This also explains why you cannot bookmark individual Gmail accounts. Let’s assume your work account has currently been assigned the number “2”. When you add a bookmark to it, the browser stores the URL shown above. When you try to open the bookmark later, it may very well be the case that the number “2” now stands for your personal Gmail account.

This behavior significantly affects user experience and practically guarantees end-user confusion.

Firefox Containers

Firefox Containers was originally developed as a Facebook container and was later converted into a generic solution. It works by separating cookies, local storage and the browser cache between containers (details).

The coolest thing about Firefox Containers, apart from the fact that it “just works”, is the neat integration into the browser’s UI.

Container tabs are color-coded:

The address bar shows the current tab’s container name and color:

Use Cases for Containers

The documentation mentions a variety of use cases. Here are my favorites:

  1. Log in to a web app with multiple accounts at the same time
  2. Create “clean” environments for testing without having to resort to private mode or deleting the cache
  3. Isolate sites like Facebook to prevent tracking and improve privacy

Installation

Head over to the Firefox add-ons site and install the add-on Firefox Multi-Account Containers by Mozilla from there.

Usage Tips

Keyboard Shortcuts

To open a new tab in a specific container press CTRL+. (control and period). This opens the containers panel below the add-on’s icon in the upper-right corner. Alternatively, press ALT+F and select New Container Tab from the menu.

Pinning Sites to Containers

To configure the browser to always open sites in the right container:

  • Open a new container tab, e.g. “work” (see above)
  • In the new tab, open the site you want to pin to the container
  • Open the containers panel (see above) and select Always open in …

Updates

Firefox 73: Container Settings Synchronization

Starting with Firefox 73.0, the container configuration and site assignments are synchronized between computers (blog post). This requires a Firefox Sync account.

Try For Yourself

If this whetted your appetite and you would like to try out Firefox Containers for yourself, take a look at my follow-up article Switching from Chrome to Firefox.

Previous Article Windows Setup USB Flash Drive Not Showing Up in BIOS List of Boot Devices
Next Article Switching from Chrome to Firefox