- JavaScript 66.8%
- Shell 12.4%
- CSS 10.6%
- HTML 10.2%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| .cursor/rules | ||
| .forgejo/workflows | ||
| .githooks | ||
| .vscode | ||
| docs | ||
| scripts | ||
| xpi.src | ||
| .cursorignore | ||
| .editorconfig | ||
| .gitattributes | ||
| .gitignore | ||
| build.sh | ||
| README.md | ||
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:
- If a matching tab already exists → Close the new tab, update the existing tab with the new URL, and focus it
- 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 |
|---|
![]() |
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)
- Clone git repo.
- Open
about:debuggingin Firefox/Zen - Click "about:debugging#/runtime/this-firefox" (or "This Zen")
- Click "Load Temporary Add-on..."
- Select the
manifest.jsonfile fromxpi.srcdirectory
Usage
- Click the Sticky TabSZ icon in the toolbar
- If the current page matches a rule, you'll see the rule name
- If not, click "Create Rule..." to auto-generate a rule for this site
- 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 loadedawaitis 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.
Links
- Firefox Add-ons: https://addons.mozilla.org/en-US/firefox/addon/sticky-tabsz/
- Homepage: https://code.lksz.me/lksz/sticky-tabsz
- Issues: https://code.lksz.me/lksz/sticky-tabsz/issues
- Community: https://github.com/Lockszmith/sticky-tabsz/discussions
- Buy Me a Coffee: https://studio.buymeacoffee.com/dashboard
License
Unlicense (Public Domain)
