Natively and easily edit and open bookmarks in multi-account containers.
This extension works well with both Temporary Containers on the Mozilla-Addons-Store and Temporary Containers Plus on the Mozilla-Addons-Store.
ContainMarks attaches a one-time code (a token) to all assigned bookmarks. This ensures only bookmarked pairings open in the assigned container.
If you experience any issues with stale tokens, the extension preferences page (read more below) may be able to help.
ContainMarks works with Firefox Sync / bookmark transfer methods.
- We do not collect ANY information from you, everything is stored locally.
- There are no terms of service, use as you please. Do respect the License file, however.
- Be kind to others. This rule will be enforced by owner of this repository, at their discretion.
Test your code well before submitting it.
Using the Nix development shell (recommended in this repo), generate a Firefox extension package:
nix develop -c npm install
nix develop -c npm run build:firefoxOr without Nix (if node and npm are already installed):
npm install
npm run build:firefoxThis writes dist/*.zip (the standard WebExtension build artifact). For a local unsigned .xpi file:
nix develop -c npm run build:firefox:xpiWhen a bookmark is assigned to a container, it receives a random token and a stable container index. The assignment is embedded in the URL's fragment, so the real URL remains intact and navigable.
E.G. https://example.com -> https://example.com#cm:r4nD0Mt_k3n:4
If the original URL already had a fragment (e.g. https://example.com#section), it is preserved after the encoding:
https://example.com#cm:r4nD0Mt_k3n:4#section
The number is the stable, first-seen container mapping index.
This token is hidden when the user goes to edit the bookmark. It is hotswapped back in when the bookmark is saved. This makes native bookmark editing possible without exposing the internal workings of the extension or requiring users to not mess with the token in the URL. This is a slight oversimplification, but this is ~90% correct. Read the code for the full details.
ContainMarks stores container mapping bookmarks in the Bookmarks Menu under ContainMarks Sync.
- Folder location:
Bookmarks Menu(menu________) - Mapping bookmark title:
Mapping: {containerName} - Mapping bookmark URL:
about:{firstSeenIndex}:{cookieStoreId}:{backupName}
This keeps container references stable across renames and helps sync behavior across devices.
Token retention behavior is configurable in the options page:
Regenerate tokens on startuptoggleRegenerate tokens on every usetoggle
The page-action shortcut always creates a bookmark for the current tab URL.
- If the tab is in a container, the bookmark is container-mapped.
- If the tab is not in a container, a plain bookmark is created.
src/backgroundApp.ts: event orchestration (startup, tab update handling, context menus, page-action flow)src/containerMappingStore.ts: stable index mapping + bookmark-backed sync persistencesrc/containerMappings.ts: URL codec for bookmark and mapping formatssrc/settings.ts: settings sanitization, validation, and storage boundaries
This separation keeps encoded URL rules and sync mapping persistence independent from browser event wiring.
All code is licensed under the MIT License.
Because innovation is desirable.




