Documentation Index
Fetch the complete documentation index at: https://mintlify.com/adalidbori/Tab-Closer-Ext/llms.txt
Use this file to discover all available pages before exploring further.
Configuration Overview
Tab Closer stores all configuration in Chrome’s local storage using thechrome.storage.local API. The extension uses two key storage values to manage its behavior.
Storage Keys
fs (Feature Switch)
fs (Feature Switch)
Type:
booleanPurpose: Controls whether the extension is actively monitoring and closing tabs.Values:true- Extension is enabled (toggle shows “ON”)false- Extension is disabled (toggle shows “OFF”)
tabsallow (Tab Limit)
tabsallow (Tab Limit)
Type:
numberPurpose: Defines the maximum number of tabs allowed to be open simultaneously.Constraints:- Minimum value:
2 - Maximum value: No enforced maximum (limited by browser capabilities)
- Default value:
2(on first load)
Configuration Interface
The extension popup provides a simple, compact interface for configuration:UI Components
- Toggle Switch
- Number Input
The flip switch at the top of the popup controls the Visual States:
fs storage value.HTML Structure:- ON (Checked): Green background with “ON” text
- OFF (Unchecked): Red background with “OFF” text
Validation Rules
Tab Limit Validation
Configuration Workflow
The complete save workflow follows this sequence:Validation
The
save() function validates that tabsallow >= 2:- Valid: Proceed to save
- Invalid: Show alert “La cantidad debe ser mayor que uno!”
Storage Save
Settings are saved to
chrome.storage.local in sequence:- Save
fs(boolean) value - Save
tabsallow(number) value - Show “Saved!” confirmation message
Loading Settings
The extension automatically loads saved settings when the popup is opened:The default tab limit is 2 when the extension is first installed or if no value has been saved yet.
Popup Dimensions
The popup has a fixed size optimized for the configuration interface:Advanced Configuration
Modifying Default Values
Modifying Default Values
To change the default tab limit from 2 to another value, modify the
load() function in script.js:Changing the Minimum Tab Limit
Changing the Minimum Tab Limit
To modify the minimum allowed tab limit, update the validation in both files:script.js:background.js:
Debugging Storage Values
Debugging Storage Values
To inspect current storage values, open the extension popup, then:
- Right-click in the popup and select “Inspect”
- In the Console, run:
Best Practices
Start Conservative
Begin with a lower tab limit (5-10) and increase if needed. This helps identify your actual usage patterns.
Disable When Needed
Use the ON/OFF toggle to temporarily disable the extension during research sessions when you need many tabs.
Regular Reviews
Periodically review your tab limit setting to ensure it matches your current workflow needs.
Test Changes
After changing settings, open a few tabs to verify the extension behaves as expected.