Closed utubo closed 4 years ago
getTabs: async filter => {
const all = await browser.tabs.query({});
const tabs = [];
for (let tab of all) {
if (filter(tab)) tabs.push(tab);
}
return tabs;
},
getTabIds: tabs => {
const ids = [];
for (let tab of tabs) {
ids.push(tab.id);
}
return ids;
}
closeAll: async arg => {
const tabs = await exec.getTabs(tab => true);
browser.tabs.remove(exec.getTabIds(tabs));
}
これはやりすぎか…
↓