DEV Community

Weather Clock Dash
Weather Clock Dash

Posted on

Firefox Containers for Developers: Multi-Environment Testing, OAuth, Multiple Clients, and Teams

Firefox Multi-Account Containers have been covered in many places for individual use — work vs. personal separation, preventing tracker cross-site linking. But containers are also powerful for teams: shared container configurations, managing multi-tenant SaaS tools, and developer workflows with multiple API environments. Here's a developer-focused deep dive.

What Containers Actually Isolate

Each container has completely separate:

  • Cookies and session storage — different logins per container
  • Local storage and IndexedDB — per-container data
  • Cache — containers don't share cached responses
  • HTTP authentication — Digest/NTLM credentials are per-container

They do NOT isolate:

  • URL bar history (all searches show in dropdown regardless of container)
  • Bookmarks
  • Extensions and their data
  • Your IP address
  • WebRTC fingerprint

Think of containers as "browser-internal multiple sessions" — different logged-in state, but same network and same fingerprint.

Containers for Multi-Environment Development

Most developers work with multiple environments: local, staging, production. Each may have different login states, feature flags, and data. Containers solve the "I can't test staging because I'm logged into production" problem.

Setup:

🔴 Production — actual prod login, careful with changes
🟡 Staging — staging login, test with real staging data
🟢 Local — localhost with local dev user
🔵 Personal — your personal accounts
Enter fullscreen mode Exit fullscreen mode

With the Container Tabs extension configured, navigating to app.yourco.com in the Production container logs in with the prod token; opening the same URL in Staging opens staging.

Implementation: use the Container Tabs extension (from AMO) to assign URLs to containers. Assign app.yourco.com/staging to the Staging container.

OAuth Testing Across Containers

Testing OAuth flows with different user roles (admin, regular user, viewer) is much easier with containers:

  • Container A: logged in as admin user
  • Container B: logged in as regular user
  • Container C: logged in as viewer

Open all three in separate containers, switch between them with Ctrl+Click to open links in a specific container.

API Testing With Different Auth Tokens

Containers don't directly help with API calls from code, but they help test API-backed UIs:

When your frontend reads the auth token from localStorage/cookies to make API calls, different containers have different tokens. You can have the same page open in three containers, each calling the API with a different user's token simultaneously.

Combined with DevTools Network panel in each container tab, you can compare API responses for different users side by side.

Container Management for Contractors and Consultants

If you're a contractor working for multiple clients:

🔴 Client A — their Google Workspace, Jira, GitHub org
🟡 Client B — their tools
🟢 Client C — their tools
🔵 Personal — your own accounts
Enter fullscreen mode Exit fullscreen mode

The Container Tabs extension assigns each client's domains to their container. Opening drive.google.com in Client A container logs into their Google; same URL in Client B container opens their Google.

This eliminates the "wrong account in the wrong tab" problem that plagues consultants who previously needed multiple browser profiles.

Advanced: Userscripts per Container

Greasemonkey/Tampermonkey scripts run in all containers by default. For container-specific userscripts:

Use the script's metadata to check the container. Unfortunately, the WebExtensions API doesn't expose container ID to content scripts directly. A workaround: the user agent (if modified per container via extensions like "Container Tabs") can signal container, or use a different extension approach.

A simpler alternative: use the hostname/path to determine environment in your userscript:

// Userscript that behaves differently per environment
if (location.hostname === 'staging.yourapp.com') {
  // staging behavior
} else if (location.hostname === 'yourapp.com') {
  // production behavior
}
Enter fullscreen mode Exit fullscreen mode

Container Tabs Extension Configuration

The official Container Tabs extension (Firefox Only, from AMO) has per-site assignment:

  1. Click the container tabs icon → Manage
  2. Click a container → Add Sites
  3. Enter domains to always open in that container

Advanced: You can configure whether to automatically reopen tabs in the correct container when you navigate to an assigned domain from a different container.

Right-click any link: "Open link in..." shows all your containers. You can quickly open any link in a specific container without pre-configuring it.

Containers + Firefox Sync

Container assignments sync across devices if you use Firefox Sync. Your container setup on your laptop also applies on your work desktop, without manual reconfiguration.

Note: the containers themselves sync, but container assignments (which URLs open where) are stored by the Container Tabs extension — that extension's data may or may not sync depending on its implementation.

Limitations

  • Firefox-only: containers don't exist in Chrome/Safari/Edge. If you switch browsers, the configuration doesn't transfer.
  • Not incognito-equivalent: containers don't prevent network-level tracking, browser fingerprinting, or IP-based tracking
  • Extension access: extensions can read data across all containers (they run at the browser level, not the container level). An untrusted extension can see your production cookies.
  • Subdomains: assigning example.com to a container also opens app.example.com and docs.example.com in that container — which is usually what you want, but worth knowing

Containers vs. Firefox Profiles

Feature Containers Profiles
Isolation level Cookie/storage isolation Complete browser isolation
Extensions Shared Per-profile
Open simultaneously Yes (in same window) No (each profile is a separate process)
Switching Instant (click) Need to restart/use profile switcher
Use case Multiple accounts on same site Different browser setups

Use containers for multiple accounts on the same sites. Use profiles for fundamentally different setups (work browser vs. personal browser with different extensions, different Firefox settings).

Top comments (0)