6ae77429ce0b87f4747c4fb94f699a064c664daa
Container Bookmarks
A Firefox extension that associates bookmarks with containers. When you click a bookmark, it automatically opens in the assigned container.
Features
- Right-click context menu: Assign containers to any bookmark
- Automatic container opening: Bookmarks open directly in their assigned container
- Multiple bookmarks, same URL: Supports different containers for bookmarks pointing to the same site (e.g., personal vs work YouTube)
- Popup overview: View and manage all container-assigned bookmarks
- Auto-cleanup: Mappings are removed when bookmarks or containers are deleted
How It Works
URL Fragment Identification
When you assign a container to a bookmark, the extension adds a unique identifier fragment to the bookmark URL:
https://www.youtube.com → https://www.youtube.com#cb-abc123
The #cb-<bookmarkId> fragment allows the extension to:
- Identify which bookmark was clicked - Even if multiple bookmarks point to the same URL
- Look up the correct container - Each bookmark can have its own container assignment
- Open the clean URL - The fragment is stripped when opening the page
Navigation Interception
When you click a bookmark:
- The extension detects the
#cb-fragment in the URL - Extracts the bookmark ID from the fragment
- Looks up the container assignment for that bookmark
- Opens the clean URL (without fragment) in the assigned container
Note
: Typing a URL directly in the address bar is not intercepted - only bookmark clicks with the container fragment are redirected.
Example: Multiple YouTube Accounts
You can have two YouTube bookmarks open in different containers:
- Personal YouTube (
youtube.com#cb-personal123) → Opens in "Personal" container - Work YouTube (
youtube.com#cb-work456) → Opens in "Work" container
Installation
Temporary Installation (for development)
- Open Firefox and navigate to
about:debugging#/runtime/this-firefox - Click "Load Temporary Add-on..."
- Navigate to this folder and select
manifest.json
Permanent Installation
Package the extension as a .xpi file and submit to addons.mozilla.org for review.
Usage
Assigning a Container to a Bookmark
- Right-click on any bookmark (in bookmark toolbar, menu, or sidebar)
- Click "Set Container"
- Select the container you want
- The bookmark URL will be updated with a unique identifier
Removing a Container Assignment
- Right-click on the bookmark
- Click "Set Container" → "Remove Container Assignment"
- The bookmark URL will be restored to its original form
Opening a Bookmark in a Specific Container (One-time)
- Right-click on any bookmark
- Click "Open in Container"
- Select the container (opens without changing the bookmark's assignment)
Viewing Assigned Bookmarks
- Click the extension icon in the toolbar
- See all bookmarks with container assignments
- Click × to remove an assignment
Permissions
| Permission | Purpose |
|---|---|
bookmarks |
Read and modify bookmark URLs |
contextualIdentities |
Access container information |
cookies |
Required for container support |
storage |
Persist bookmark-container mappings |
tabs |
Open tabs in specific containers |
menus |
Add context menu items |
webNavigation |
Detect bookmark navigation and redirect |
Development
# Clone the repository
git clone https://github.com/yourusername/firefox-container-tab.git
# Load in Firefox for testing (see Installation above)
License
MIT License
Description
Languages
JavaScript
82%
CSS
14%
HTML
4%