MCPcopy Index your code
hub / github.com/philc/vimium / moveTabToNewWindow

Function moveTabToNewWindow

background_scripts/main.js:302–312  ·  view source on GitHub ↗
({ count, tab })

Source from the content-addressed store, hash-verified

300 }),
301
302 moveTabToNewWindow({ count, tab }) {
303 // TODO(philc): Switch to the promise API of chrome.tabs.query.
304 chrome.tabs.query(visibleTabsQueryArgs, function (tabs) {
305 const activeTabIndex = getTabIndex(tab, tabs);
306 const startTabIndex = Math.max(0, Math.min(activeTabIndex, tabs.length - count));
307 [tab, ...tabs] = tabs.slice(startTabIndex, startTabIndex + count);
308 chrome.windows.create({ tabId: tab.id, incognito: tab.incognito }, function (window) {
309 chrome.tabs.move(tabs.map((t) => t.id), { windowId: window.id, index: -1 });
310 });
311 });
312 },
313
314 nextTab(request) {
315 return selectTab("next", request);

Callers

nothing calls this directly

Calls 1

getTabIndexFunction · 0.85

Tested by

no test coverage detected