aboutsummaryrefslogtreecommitdiff
path: root/src/background/actions/command.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/background/actions/command.js')
-rw-r--r--src/background/actions/command.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/background/actions/command.js b/src/background/actions/command.js
index 4c52bca..75d04bf 100644
--- a/src/background/actions/command.js
+++ b/src/background/actions/command.js
@@ -17,6 +17,12 @@ const tabopenCommand = (url) => {
return browser.tabs.create({ url: url });
};
+const tabcloseCommand = () => {
+ return browser.tabs.query({ active: true }).then((tabList) => {
+ return browser.tabs.remove(tabList.map(tab => tab.id));
+ });
+};
+
const winopenCommand = (url) => {
return browser.windows.create({ url });
};
@@ -70,6 +76,9 @@ const exec = (line, settings) => {
return bufferCommand(args);
case 'set':
return setCommand(args);
+ case 'q':
+ case 'quit':
+ return tabcloseCommand();
case '':
return Promise.resolve();
}