A Chrome extension for managing browser windows and tabs with a beautiful masonry layout interface.
Quick access popup showing all windows and tabs
Full manager interface with masonry layout
- Masonry Layout: Tabs and windows displayed in a Pinterest-style masonry grid that efficiently uses screen space
- Window Management: View all open windows and tabs in one place
- Drag & Drop: Move tabs between windows with intuitive drag and drop
- Bulk Operations: Select multiple tabs and move them to a new window
- Domain Grouping: Group tabs by domain for better organization
- Search: Quickly find tabs by URL
- Multiple View Modes:
- Masonry (default) - Column-based layout
- List - Single column view
- Full Masonry - Uses full screen width
- View Sizes: Normal, Compact, and Ultra-compact modes
- Handles all Chrome API interactions
- Implements secure message passing between extension components
- Manages window and tab operations (create, close, move, focus)
- Validates all incoming messages for security
- Quick access view from the extension icon
- Shows all windows with their tabs
- Allows quick focusing and closing of windows/tabs
- Links to full manager interface
- Full-featured tab management interface
- Implements the
WindowManagerclass that handles:- Window and tab rendering
- Drag and drop functionality
- Search and filtering
- Bulk selections
- Domain grouping
- View mode switching
- JavaScript-based layout system (avoids CSP violations)
- Calculates optimal column placement
- Responsive column count based on viewport
- Debounced resize handling
- Mutation observer for dynamic content
-
Chrome APIs → Background Script
- All Chrome API calls go through the background service worker
- Ensures consistent error handling and security
-
Background Script ↔ UI Components
- Secure message passing using Chrome runtime messaging
- All messages validated before processing
- Async/await pattern for clean error handling
-
UI State Management
- WindowManager class maintains UI state
- Real-time updates via Chrome event listeners
- Optimistic UI updates with rollback on error
- Input Validation: All user inputs sanitized and validated
- Message Validation: Background script validates all incoming messages
- Content Security Policy: No inline scripts, all JavaScript in separate files
- HTML Escaping: All dynamic content properly escaped to prevent XSS
-
Masonry Layout: Uses absolute positioning with JavaScript calculations instead of CSS Grid/Flexbox to achieve true masonry effect
-
Domain Grouping: Tabs grouped by domain when enabled, with collapsible sections and bulk actions per domain
-
Drag & Drop: Native HTML5 drag and drop API with visual feedback and drop zones
-
Performance: Debounced operations, efficient DOM updates, and lazy loading for large tab counts
tabflow/
├── manifest.json # Extension manifest (Manifest V3)
├── background.js # Service worker for Chrome API operations
├── popup.html # Popup interface HTML
├── popup.js # Popup interface logic
├── popup.css # Popup interface styles
├── manager.html # Full manager interface HTML
├── manager.js # Manager interface logic (WindowManager class)
├── manager.css # Manager interface styles
├── masonry-layout.js # Masonry layout calculations
└── assets/
└── icons/ # Extension icons (16x16 to 128x128)
The extension uses vanilla JavaScript with no build process required. Simply load the unpacked extension in Chrome to test changes.
chrome.tabs.*- Tab managementchrome.windows.*- Window managementchrome.runtime.*- Extension messagingchrome.storage.*- Preference storage (prepared for future use)
- Chrome/Chromium browsers with Manifest V3 support
- Requires Chrome 88+ for full feature support
This project is licensed under the MIT License - see the LICENSE file for details. You are free to use, modify, and distribute this software in any way you like.