Merge All Browser Windows Into One
Merging browser windows moves the tabs from every open window into a single window. Tab groups move across as whole units, so grouped tabs stay together rather than scattering. It is the fastest way to gather a sprawl of windows back into one.
Why it matters
Over the course of a day, you accumulate windows. You open one for email, pop out a second for a video call, start a third to focus on one project. By evening, you have four windows scattered across your screen, each with ten or twenty tabs. Finding anything means hunting through windows.
Merging consolidates everything into one window. All your tabs land in the same place, grouped tabs move across whole so your organisation stays intact, and you go from managing four scattered windows to one busy-but-unified one. It is much faster than moving tabs one at a time or closing windows and hoping you do not lose anything.
How it works
A merge takes every open window, gathers all the tabs from each one, and moves them into a single target window. The tricky part is keeping groups together.
The Chrome API has a quirk: if you call chrome.tabs.move() on a single tab that is inside a group, that tab drops out of its group. It moves, but it leaves the group behind. So a naive merge that just moves all tabs individually would scatter your groups across the merged window.
Scalpel Manage Tabs works around this with a two-phase approach. First, it moves entire groups using chrome.tabGroups.move(), which keeps all the tabs in each group together. Then it moves the ungrouped tabs using chrome.tabs.move(). Nothing gets stranded halfway. Groups stay intact, tabs inside them stay together, and only loose tabs are moved individually.
Pinned tabs stay pinned when they move. They land among the target window's pinned tabs, keeping their pinned state and their position in the left part of the strip.
What does not matter
After a merge, you still have only one window. If you opened four windows on purpose because you wanted separate workspaces, a merge defeats that. But if you opened them by accident or just because you were multitasking, a merge lets you reclaim screen space and put your tabs back in focus.
Merging does not reorganise your groups. A group called "Email" in window A stays called "Email" after the merge. A group with the same name in window B keeps its own title. If two windows have a group with the same title, they remain separate groups. There is no automatic deduplication or renaming.
Code example
Here is how the extension merges windows while preserving groups:
async function mergeAllWindows() {
const allWindows = await chrome.windows.getAll();
if (allWindows.length < 2) return;
const targetWindowId = allWindows[0].id;
const sourceWindows = allWindows.slice(1);
// First pass: move whole groups
for (const window of sourceWindows) {
const tabs = await chrome.tabs.query({ windowId: window.id });
const groups = new Set(tabs.map(t => t.groupId).filter(g => g !== -1));
for (const groupId of groups) {
await chrome.tabGroups.move(groupId, { windowId: targetWindowId });
}
}
// Second pass: move ungrouped tabs
for (const window of sourceWindows) {
const tabs = await chrome.tabs.query({ windowId: window.id, groupId: -1 });
const tabIds = tabs.map(t => t.id);
if (tabIds.length > 0) {
await chrome.tabs.move(tabIds, { windowId: targetWindowId, index: -1 });
}
}
// Close source windows
for (const window of sourceWindows) {
await chrome.windows.remove(window.id);
}
}
How Scalpel Manage Tabs shows it
Scalpel Manage Tabs adds a merge button to the window list. Click it and the extension pulls all tabs from every open window into the first window, moving groups whole so nothing scatters. It then closes the empty source windows. Because the merge creates one busy window with potentially dozens of tabs, the full window view (opened with the window-view button or by pressing Alt+Shift+M) gives you a better overview. You can collapse groups, search, and sort without the popup vanishing when you click into another window.