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

Function forCountTabs

background_scripts/main.js:430–437  ·  view source on GitHub ↗
(count, currentTab, callback)

Source from the content-addressed store, hash-verified

428};
429
430async function forCountTabs(count, currentTab, callback) {
431 const tabs = await chrome.tabs.query(visibleTabsQueryArgs);
432 const activeTabIndex = getTabIndex(currentTab, tabs);
433 const startTabIndex = Math.max(0, Math.min(activeTabIndex, tabs.length - count));
434 for (const tab of tabs.slice(startTabIndex, startTabIndex + count)) {
435 callback(tab);
436 }
437}
438
439// Remove tabs before, after, or either side of the currently active tab
440async function removeTabsRelative(direction, { count, tab }) {

Callers 3

removeTabFunction · 0.85
togglePinTabFunction · 0.85
reloadFunction · 0.85

Calls 1

getTabIndexFunction · 0.85

Tested by

no test coverage detected