Press Alt + Shift + S or click the badge to destroy half your tabs. (rounded down, must have at least 2 tabs to destroy a tab, will not destroy your current tab)
This extension definitely works in Chrome. Whether it works in other chromium based browsers (Edge, Brave, Opera) has not been tested. It does not work in Firefox because of Manifest v3. It does not work in Safari, probably.
If you'd like to port this to your browser, feel free to fork.
- switch from callbacks to promises once they are implemented
- use
chrome.action.openPopupto give the keyboard shortcut the same experience as clicking the extension icon, once chrome supports it (if they ever will... see below)
The intended design for this extension was to close half of all open tabs and show a Thanos quote in the popup every time the extension was prompted, regardless of if that was through the badge or the keyboard shortcut. The badge implementation is done via message passing. A script in the popup triggers the background tab deletion function through an event. Getting the popup to trigger from the keyboard shortcut would require a call to chrome.action.openPopup after the tabs were closed to show the popup. The documentation says that the function is available as of chrome version 99 and newer. However, there are multiple bug reports that this function is not implemented.