Firefox/Zen Extension to help keep tabs from multiplying like rabbits
  • JavaScript 66.8%
  • Shell 12.4%
  • CSS 10.6%
  • HTML 10.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
lksz b776883f9f
All checks were successful
Release Tag / Tag Release (push) Successful in 5s
Release / Build Release (push) Successful in 50s
Merge pull request 'ci: use automatic GITHUB_TOKEN for Forgejo releases' (#12) from dev into main
Reviewed-on: #12
2026-10-29 02:11:27 +00:00
.cursor/rules ci: use automatic GITHUB_TOKEN for Forgejo releases 2026-10-28 22:05:16 -04:00
.forgejo/workflows ci: use automatic GITHUB_TOKEN for Forgejo releases 2026-10-28 22:05:16 -04:00
.githooks chore: added git commit hooks to ensure valid commits 2025-12-10 22:21:36 -05:00
.vscode chore: added vscode tasks to invoke test-repo script 2025-12-10 22:22:05 -05:00
docs feat(snippets): per-snippet Sync opt-out and snippet-only rule actions 2026-10-28 21:22:55 -04:00
scripts fix(build): derive version-bump expectations from manifest version in test-build.sh 2026-10-25 21:50:11 -04:00
xpi.src chore: bump version to 0.2.1 2026-10-29 02:07:36 +00:00
.cursorignore chore: add initial documentation plans for local rule toggles, JavaScript action, snippet library, and redirection prompt features 2026-10-25 20:53:28 -04:00
.editorconfig chore: add .gitattributes forcing LF line endings 2025-12-10 22:19:02 -05:00
.gitattributes chore: add .gitattributes forcing LF line endings 2025-12-10 22:19:02 -05:00
.gitignore Add .gitignore, AMO submission notes, and initial extension files 2025-12-06 20:02:15 -05:00
build.sh fix(build): keep --lint-only non-interactive and version-stable 2026-10-26 09:57:57 -04:00
README.md Add .gitignore, AMO submission notes, and initial extension files 2025-12-06 20:02:15 -05:00

Sticky TabSZ

Firefox/Zen Extension to prevent tabs from multiplying like rabbits 🐰

What It Does

When you open a link matching the configured pattern, the extension will:

  1. If a matching tab already exists → Close the new tab, update the existing tab with the new URL, and focus it
  2. If no matching tab exists → The new tab becomes the sticky tab for that container

This prevents tab clutter when repeatedly opening links to the same type of page.

📸 All Screenshots
Click for more screenshots

Features

  • Configurable Rules — Create rules with regex patterns for any site
  • Quick Rule Creation — Click the toolbar icon to create a rule for the current page
  • Run JavaScript Action — Optionally run your own script in the sticky tab (destination URL available as url) instead of reloading it
  • Snippet library — Pick a predefined snippet, clone it, or add one from a rule's snippet menu. Your snippets sync with your rules unless you turn Sync off on that snippet; predefined ones ship with the extension
  • Multi-Account Container support — Each container gets its own independent sticky tab
  • SPA-aware — Handles single-page app navigation (like Salesforce Lightning)
  • Redirect-aware — Works with SSO redirects and other redirect chains
  • Sync Support — Rules are synchronized over Firefox Sync (can be disabled)
  • Per-Rule Local Override — When sync is on, uncheck "Sync this rule" on any rule to keep edits on this device only; re-syncing a rule that changed on both sides offers a Keep Local / Keep Remote / Cancel choice
  • Import/Export — Backup/Restore rules and settings from file.

Installation

Install from Firefox Add-ons (Currently in review)

Temporary (Development)

  1. Clone git repo.
  2. Open about:debugging in Firefox/Zen
  3. Click "about:debugging#/runtime/this-firefox" (or "This Zen")
  4. Click "Load Temporary Add-on..."
  5. Select the manifest.json file from xpi.src directory

Usage

  1. Click the Sticky TabSZ icon in the toolbar
  2. If the current page matches a rule, you'll see the rule name
  3. If not, click "Create Rule..." to auto-generate a rule for this site
  4. Customize the pattern and save

Run JavaScript Action

For each rule, under Advanced: Action, you can choose what happens when a matching URL is redirected to its sticky tab:

  • Reload sticky tab with URL (default) — the sticky tab navigates to the new URL
  • Run JavaScript in sticky tab — the sticky tab stays as-is and your script runs instead

Inside the script:

  • url — the destination URL that would have been loaded
  • await is supported (the script runs inside an async function)
  • Runs in the top frame of the sticky tab as a content script (not subject to the page's CSP). Page globals (for example Salesforce $A) are in scope directly, so snippets behave like bookmarklets:
// works exactly as it would in a bookmarklet:
var ev = $A.getEvt("markup://force:navigateToURL");

Example (SPA-friendly navigation without a reload):

console.log('sticky target:', url);
document.title = 'STICKY: ' + new URL(url).pathname;
history.replaceState(null, '', new URL(url).pathname + new URL(url).search);

If the script throws or rejects, Sticky TabSZ opens a small prompt with the error and lets you reload the sticky tab, keep the URL in the new tab (with sticky temporarily bypassed for that tab), or cancel. The script is checked for syntax errors (via the bundled Acorn parser) before you can save.

The action runs a snippet. The Snippets tab lists predefined snippets (including a Salesforce Lightning navigation helper and a demo exception that shows the error prompt's call stack) and any snippets you create. On a rule, choose New snippet… in the snippet menu to write one and select it. Cloning a predefined snippet opens the editor — ACE 1.45.2, vendored under vendor/ace/ — so you can change the copy. Your snippets are stored with your rules and follow Firefox Sync when that is on. Each of your snippets has a Sync toggle (on by default) in the catalog and in the editor; uncheck it to keep that snippet on this device. Predefined snippets are part of the extension and are not synced, so an update can replace them. A rule that points at a snippet which is no longer in the library shows a missing-snippet chip and, at run time, reloads the sticky tab.

License

Unlicense (Public Domain)