Adds command to close all tabs

Type :qa or :quitall to close all tabs
Bu işleme şunda yer alıyor:
João Vitor Brandão 2018-05-24 17:14:19 -03:00
ebeveyn 982a54c0aa
işleme 4445309334
2 değiştirilmiş dosya ile 16 ekleme ve 1 silme

Dosyayı Görüntüle

@ -27,6 +27,14 @@ const tabcloseCommand = () => {
});
};
const tabcloseAllCommand = () => {
return browser.tabs.query({
currentWindow: true
}).then((tabList) => {
return browser.tabs.remove(tabList.map(tab => tab.id));
});
};
const winopenCommand = (url) => {
return browser.windows.create({ url });
};
@ -117,6 +125,9 @@ const exec = (tab, line, settings) => {
case 'q':
case 'quit':
return tabcloseCommand();
case 'qa':
case 'quitall':
return tabcloseAllCommand()
case '':
return Promise.resolve();
}