Skip to content

Filipe07/zen-unload-tab

Repository files navigation

Zen Unload Tab

Extension for Zen Browser (based on Firefox) that allows you to force unload the current tab using a keyboard shortcut.

Features

  • Default shortcut: Shift+Cmd+S (macOS) or Shift+Ctrl+S (Windows/Linux)
  • Smart toggle:
    • If tab is loaded → unloads the tab, freeing memory
    • If tab is unloaded → reloads the tab
  • Visual unload page: When a tab is unloaded, shows a beautiful page indicating it's unloaded
  • Automatic reload: Click on the unloaded tab or use the shortcut again to reload
  • Works only with tabs that can be discarded

Installation

Development Mode (Temporary)

  1. Open Zen Browser
  2. Navigate to about:debugging
  3. Click "This Firefox" (or equivalent)
  4. Click "Load Temporary Add-on..."
  5. Select the manifest.json file from this extension
    • Note: If you haven't created icons yet, you can use manifest-no-icons.json temporarily

Permanent Mode (Packaged)

  1. Package the extension:

    ./build.sh

    Or manually:

    zip -r zen-unload-tab.zip manifest.json background.js unloaded.html unloaded.js README.md icons/
  2. In Zen Browser, go to about:addons

  3. Click the gear icon and select "Install Add-on From File..."

  4. Select the zen-unload-tab-*.zip file

Shortcut Customization

The shortcut can be customized:

  1. Go to about:addons
  2. Find "Zen Unload Tab"
  3. Click "..." → "Manage Extension Shortcuts"
  4. Configure the desired shortcut for the "unload-tab" command

The default shortcut Shift+Cmd+S avoids conflicts with the default "Save" shortcut (Cmd+S).

Technical Notes

  • Uses Firefox/WebExtensions tabs.discard() API
  • Only tabs with autoDiscardable: true can be discarded
  • Original URL is saved in browser.storage.local when tab is unloaded
  • When an unloaded tab is activated, shows a custom HTML page (unloaded.html)
  • Tab only reloads when you click on it or use the shortcut again
  • Original tab title is preserved in the tab bar

Development

This extension is compatible with:

  • Zen Browser
  • Firefox (all versions that support WebExtensions)

License

MIT

About

Zen browser unload tab shortcut

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors