The Scalpel Right-Click Menu for Suspending Tabs
Scalpel adds up to three actions to the right-click menu on any web page: suspend the tab you are on, suspend every other tab in the window, or add the site to your never-suspend list. You can switch each one off in settings.
Why it matters
The popup is convenient, but sometimes you're deep in a page and don't want to click the extension icon. Right-click anywhere on the page and Scalpel can add suspend and never-suspend options straight into Chrome's context menu. It's one click instead of two. And if you're the type of person who rarely uses the popup (you prefer shortcuts or the automatic timer), the right-click menu is a handy escape hatch.
How it works
Scalpel uses Chrome's chrome.contextMenus API to add items to the right-click menu. When you right-click on any regular web page (http or https), Chrome runs through all extensions that have registered context menu items and shows them.
Suspend this tab does what it says: it suspends the tab you're currently on. But because suspending the active tab would cause it to reload immediately (which is jarring), Scalpel first moves you to a neighbouring tab, then suspends the original one.
Suspend other tabs in this window uses the same logic as the Alt+Shift+S keyboard shortcut: it suspends every other tab in your current window, leaving the one you're on open. It respects all exclusions (pinned, audible, never-suspend list, unsaved input).
Never suspend this site adds the current page's hostname to your never-suspend list, so Scalpel won't suspend any tabs from that domain in future. Clicking it again removes the site from the list.
These items appear in a submenu called "Scalpel" (or whatever the parent label is) inside the right-click menu. The submenu collapses to a single "Scalpel" item if you've disabled all but one of the three actions.
What does not matter
The right-click menu only appears on web pages. You can't right-click on chrome:// pages, extension pages, or PDFs and see Scalpel's menu. Those pages aren't suspendable anyway, so there's nothing for Scalpel to do.
Toggling the menu items doesn't affect the popup or keyboard shortcuts. If you turn off the right-click menu in settings, the "Suspend" button in the popup still works, and Alt+S still fires. The settings apply to that UI layer only.
Each menu item is independent. You can turn on "Suspend this tab" and turn off "Never suspend this site," or vice versa. The choices are saved per device in local storage (not synced across your other Chrome instances, unlike the never-suspend list itself).
Code example
Here's how Scalpel creates and listens for these menu items:
// Create the context menu items
chrome.contextMenus.create({
id: "suspendThisTab",
title: "Suspend this tab",
contexts: ["page"]
});
chrome.contextMenus.create({
id: "suspendOtherTabs",
title: "Suspend other tabs",
contexts: ["page"]
});
chrome.contextMenus.create({
id: "neverSuspendSite",
title: "Never suspend this site",
contexts: ["page"]
});
// Listen for clicks
chrome.contextMenus.onClicked.addListener((info, tab) => {
if (info.menuItemId === "suspendThisTab") {
// Switch to neighbour, then suspend
suspendTabHandling(tab);
} else if (info.menuItemId === "suspendOtherTabs") {
// Suspend all other tabs in this window
suspendOtherTabsHandling(tab);
} else if (info.menuItemId === "neverSuspendSite") {
// Toggle the site on the never-suspend list
toggleNeverSuspendSite(tab.url);
}
});
When the user right-clicks, Chrome shows these items in the context menu. When they click one, Scalpel's listener fires the corresponding action.
How Scalpel shows it
The right-click menu is controlled from Scalpel's settings panel. There's a section called "Context Menu" with three toggles:
- "Suspend this tab"
- "Suspend other tabs"
- "Never suspend this site"
Each toggle is on by default. If you turn off "Suspend this tab" but leave "Never suspend this site" on, only that one item will appear when you right-click. If you turn all three off, the Scalpel submenu disappears from the context menu entirely.
The setting is saved instantly (no "Save settings" button needed) and applies the next time you right-click on a page.