This Firefox extension automatically synchronizes tab groups with contextual identities (Firefox Multi-Account Containers). It is designed for Firefox 139+ and leverages the latest browser APIs for tab group and container management.
showcase.mp4
- Automatic Container Management:
- Creates a contextual identity (container) for each tab group, using the group’s name and color.
- Moves tabs into their corresponding containers when a tab group is created or updated.
- Cleans up containers when tab groups are removed, including moving tabs back to the default container.
- Automatic Deletion of Containers:
- When a tab group is deleted, the extension deletes the associated container (contextual identity).
- Tab State Handling:
- Handles discarded and incomplete tabs robustly, activating or reloading them as needed before moving.
- Concurrency and Race Condition Prevention:
- Uses locking mechanisms to prevent race conditions when moving tabs or creating/deleting containers.
- Persistent Mapping:
- Maintains a persistent mapping between tab group IDs and container IDs in extension storage.
- Logging:
- Logs all major operations and errors to the console for easier debugging.
- Localization:
- Uses extension-localized strings for default container names.
Visit https://addons.mozilla.org/de/firefox/addon/container-tab-groups-sync/ and click "Add to Firefox"!
To install this extension, follow these steps:
-
Download the Extension File:
- Download the extension file from the releases page.
-
Open Firefox Add-ons Page:
- Open Firefox and type
about:addonsin the address bar, then press Enter.
- Open Firefox and type
-
Install the Extension:
- In the Add-ons Manager tab, click on the gear icon in the top-right corner and select "Install Add-on From File."
- Navigate to the location where you downloaded the file, select it, and click "Open."
-
Enable Unsigned Extensions (if necessary):
- Since this extension is not signed by Mozilla, you may need to enable the installation of unsigned extensions. (May only be possible with Firefox Developer Edition or Firefox Beta) To do this:
- Type
about:configin the address bar and press Enter. - Search for
xpinstall.signatures.required. - Double-click on the preference to set it to
false.
- Type
- Since this extension is not signed by Mozilla, you may need to enable the installation of unsigned extensions. (May only be possible with Firefox Developer Edition or Firefox Beta) To do this:
You should now see the extension listed in your Add-ons Manager.
These instructions will help you set up the project for development and testing.
- Node.js and npm
- Firefox Developer Edition (recommended for testing)
-
Clone the repository:
git clone https://github.com/SerafimDietrich/container-tab-groups-sync.git cd container-tab-groups-sync -
Install dependencies:
npm install
-
Build the extension:
npm run build
This compiles TypeScript and copies non-TypeScript files to
dist/. -
Run in Firefox:
npm run serve
This launches the extension in Firefox using
web-extfrom thedist/directory.
To build a distributable artifact (build the extension beforehand):
npm run build-artifactsrc/– Source code for the extension_locales/– Localization filesicons/– Iconsbackground.ts– Main background scriptmanifest.json– Extension manifest
.prettierrc– Prettier configurationeslint.config.js– ESLint configurationpackage.json– Project metadata and scriptstsconfig.json– TypeScript configurationweb-ext-config.cjs– Configuration for web-ext
- This project uses ESLint for linting and Prettier for code formatting.
- TypeScript is used for type safety. Some Firefox APIs (e.g.,
tabGroups) may not be present in TypeScript definitions; use@ts-ignorewhere necessary. - All user-facing strings should use extension localization (i18n) where possible.
- Container Deletion: The extension deletes containers it created for tab groups when those groups are removed. If you assign an existing container to a group, it may be deleted if the group is deleted.
- No ES Modules: The background script must not use ES module imports/exports. Use only top-level code and CommonJS style.
- Firefox-Only: This extension is designed for Firefox 139+ and will not work in browsers without tab group and contextual identity support.
- TypeScript API Gaps: Some Firefox APIs (e.g.,
tabGroups) may not be present in TypeScript definitions. The code uses@ts-ignorewhere necessary.
This project uses semantic versioning in the format: x.y.z
- Major (x): Increased for major changes. Resets feature (y) and hotfix (z) to zero when incremented.
- Feature (y): Increased for new features (with or without bug fixes). Resets hotfix (z) to zero when incremented.
- Hotfix (z): Increased for bug fixes only.
Contributions are welcome! To contribute:
- Fork the repository and create your branch from
master. - Ensure your code is clean, well-documented, and passes linting/formatting checks.
- Add or update tests if applicable.
- Submit a pull request with a clear description of your changes.
For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License. See the LICENSE file for details.