demo.mp4
This is a Firefox ONLY extension built with WXT.
Requires Firefox 142 or newer.
This extension does not collect any data nor send any data to any server.
Check the width of currently focused Firefox window every 0.1 second:
- If width <= user defined threshold, enable vertical tab
- If width > user defined threshold, disable vertical tab
The user defined threshold is 1080 (in pixels) by default.
You may also choose to reverse this behavior, so that vertical tabs are enabled when the window width is above the threshold (and vice versa).
You can edit these settings in the extension's menu.
The window.onresize
event listener is indeed the most obvious solution to the problem.
However, I can only use it within content scripts, which do not work in privileged domains (e.g. about:config
, Mozilla domains).
In addition, requiring a content script means the extension would need access to all domains. This might discourage some users from installing it.
Weighing these points, I decided to use an interval in a background script instead. Checking 10 times per second is not much of a burden for modern PCs anyway.
In fact, there is a windows.onBoundsChanged
event listener (MDN) that can work in background script. The problem is that Firefox hasn't implement it (lol).
Please leave a comment in this Bugzilla to nudge them to implement it. In the meantime, please also upvote this per-window vertical tab setting feature request.
- Fedora 42 KDE
- Firefox Developer Edition (142.0b5)
- Node.js 22.17.1
npm install
npm run zip
- Write Playwright tests
The app icon (created by Smashicons) is downloaded from flaticon.com for free.