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