scalpel@labs: ~/glossary/suspend-a-tab.mdx5 sections

How to Suspend a Tab Right Now

Suspending a tab discards it on demand rather than waiting for the inactivity timer. Scalpel frees the page's memory using Chrome's native discard; the tab keeps its title and position and reloads when you next open it.

extension: Scalpel Tab Suspenderupdated: 2026-08-14read_time: 2 min
less suspend-a-tab.mdx

Why it matters

The automatic sweep works on a timer. If your timer is set to 30 minutes and you just opened a memory-hungry tab by accident, you don't want to wait half an hour for it to suspend.

Suspend now lets you free a tab's memory instantly, on demand. This is useful when you spot a tab that's eating resources, or when you're about to do something that needs as much RAM as possible.

How it works

When you click "Suspend now" or press Alt+S, Scalpel sends a discard command to Chrome for the tab you're viewing. Chrome tears down the renderer process, freeing the memory.

If you're viewing the tab you're suspending, Chrome has to move focus to a different tab first. Otherwise, the tab would reload instantly (an active discarded tab reloads on its own), which defeats the purpose. So Scalpel switches you to a neighbouring tab, then suspends the one you were on.

The tab keeps its title, favicon, and position in the strip. When you click it later, it reloads from the network. If you were filling out a form, that text is lost (because the page reloads), so Scalpel won't suspend a tab with unsaved input unless you confirm it.

What does not matter

Suspending one tab doesn't affect the others. The inactivity timer keeps running on every other tab. Your settings stay the same.

You can't suspend a tab that's pinned, audible, on your never-suspend list, or has unsaved input, unless you explicitly override. These protections are there to prevent accidental data loss. If you really want to suspend one of these tabs, the confirmation dialog gives you the option.

You can't suspend the only tab in a window, or a chrome:// or extension page. Chrome doesn't allow discarding those.

Code example

Here's the suspend-now flow:

// Get the current active tab
async function suspendCurrentTab() {
  const tabs = await chrome.tabs.query({ active: true, currentWindow: true });
  const currentTab = tabs[0];

  if (!currentTab) {
    console.log('No active tab');
    return;
  }

  // Check if it's protectable (not chrome://, not the only tab, etc.)
  if (!canBeSuspended(currentTab)) {
    showMessage('This tab cannot be suspended');
    return;
  }

  // Check exclusions
  const isProtected = await isTabProtected(currentTab);
  if (isProtected) {
    // Ask the user for confirmation
    const confirm = await showConfirmDialog(
      'This tab is protected (pinned, audible, etc.). Suspend anyway?'
    );
    if (!confirm) return;
  }

  // Move focus to a neighbour tab first
  const allTabs = await chrome.tabs.query({ windowId: currentTab.windowId });
  const nextTab = allTabs.find(t => t.index > currentTab.index) || allTabs[0];
  if (nextTab && nextTab.id !== currentTab.id) {
    await chrome.tabs.update(nextTab.id, { active: true });
  }

  // Now suspend the tab
  await chrome.tabs.discard(currentTab.id);
  console.log(`Suspended tab: ${currentTab.title}`);
}

// Helper: can this tab be suspended?
function canBeSuspended(tab) {
  // Can't suspend chrome://, extension://, or internal pages
  if (!tab.url.startsWith('http://') && !tab.url.startsWith('https://')) {
    return false;
  }

  // Can't suspend the only tab
  // (This check would require querying the window's tab count)
  return true;
}

// Helper: is the tab protected by any exclusion?
async function isTabProtected(tab) {
  if (tab.pinned) {
    const { protectPinned } = await chrome.storage.sync.get({ protectPinned: true });
    if (protectPinned) return true;
  }

  if (tab.audible) {
    const { protectAudible } = await chrome.storage.sync.get({ protectAudible: true });
    if (protectAudible) return true;
  }

  if (await isOnNeverSuspendList(tab.url)) return true;
  if (await tabHasUnsavedInput(tab.id)) return true;

  return false;
}

// Keyboard shortcut: Alt+S
chrome.commands.onCommand.addListener((command) => {
  if (command === 'suspend-current') {
    suspendCurrentTab();
  }
});

How Scalpel shows it

The popup shows a "Suspend now" button. Click it to suspend the active tab. The keyboard shortcut Alt+S does the same thing hands-free, as long as you're in a window where Scalpel's commands are not shadowed by another extension or site.

Sources