An Search Engine specifically Chrome for now Extention that helps in Sorting of tabs.
A simple Chrome extension to help you instantly sort your messy browser tabs and find what you need.
We've all been there. Dozens of tabs open. You're researching, working, or shopping, and your browser becomes a cluttered mess. It's impossible to find anything, and productivity grinds to a halt.
The goal of this project is to fix that "tab clutter" with a one-click solution that organizes your open tabs.
The "data" for this extension is your live browser state, which we access using the Chrome Extensions API.
- Source:
chrome.tabsAPI. - Key Data Structure: The
chrome.tabs.Tabobject. - Important Properties:
id(number): The tab's unique ID.windowId(number): The window the tab lives in.title(string): The text you see on the tab.url(string): The web address.index(number): The tab's current position.
Before we can sort, we need to grab and clean the data.
- Retrieve: We use
chrome.tabs.query()to get anArrayof all openTabobjects. - Filter: The user might only want to sort the current window. We filter the list based on the
windowId. - Transform: To sort by website, we parse the
url(e.g., "docs.google.com/spreadsheets/...") to get the root domain ("google.com"). This domain becomes our sorting key.
This is the "magic" of the extension. The core logic lives in service_worker.js.
- A user clicks the "Sort" button in the popup (
popup.html). popup.jssends a message to theservice_worker.js.- The service worker gets the list of tabs (from Step 3).
- It runs a JavaScript
.sort()function on the array, grouping them based on the domain (or other criteria). - Finally, it iterates through the newly sorted list and physically moves the tabs in your browser using
chrome.tabs.move()andchrome.tabs.group().
This is deployed as an "unpacked" Chrome extension.
- Download: Clone or download this repository as a ZIP and unzip it to a folder you'll remember.
- Open Extensions: In Chrome, go to
chrome://extensions. - Enable Developer Mode: Find the Developer mode toggle in the top-right corner and switch it ON.
- Load the Extension: Click the Load unpacked button that appears.
- Select Folder: In the file dialog, select the
Entab-Dfolder you created in step 1.
The Entab-D icon will now appear in your Chrome toolbar!
- Click the Entab-D icon in your toolbar.
- Click the "Sort Tabs" button.
- Watch your tabs organize themselves.
manifest.json: The extension's "brain." It tells Chrome what files to use, what permissions it needs (liketabs,storage,tabGroups), and where the popup is.service_worker.js: The background script that does all the heavy lifting (querying, sorting, and moving tabs).popup.html/popup.js/popup.css: The small window that appears when you click the extension icon.options.html/options.js: The (optional) settings page for the extension.
Main Data Types Used:
Object: For thechrome.tabs.Tabdata.Array: To hold the list of all tabs:[Tab, Tab, Tab, ...].String: For URLs and titles.Integer: For tab and window IDs.
This document outlines current known issues and planned future enhancements.
- Issue: When a group's rules are changed, tabs already in that group are not re-evaluated.
- Result: Tabs that no longer match the new rules remain in the group incorrectly.
- Example: If a group's rule is changed from
url contains "google.com"tourl contains "bing.com", any existing "google.com" tabs are not automatically removed.
- Example: If a group's rule is changed from
- Issue: When the extension is enabled, it does not scan or group tabs that are already open.
- Result: The grouping logic only applies to newly created tabs, forcing users to manually organize their existing session.
- Goal: Prevent duplicate groups across multiple browser windows.
- Concept: Instead of creating isolated groups in each window (e.g., a "Work" group in Window 1 and another in Window 2), the extension should scan all windows and consolidate matching tabs into a single group in one window.
- Challenge: Requires a clear strategy for choosing the "target" window and moving tabs without disrupting the user's workflow.
- Goal: Notify users when their rules overlap.
- Concept: Implement a UI indicator (e.g., a tooltip or icon) when a single tab matches the criteria for multiple different groups.
- Result: This helps users debug their own rule sets and understand why a tab might be grouped in an unexpected way, leading to more predictable behavior.