Skip to content
This repository has been archived by the owner on Feb 26, 2021. It is now read-only.

Commit

Permalink
Start #269, add close tab intent
Browse files Browse the repository at this point in the history
  • Loading branch information
ianb committed Sep 18, 2019
1 parent 51ad41c commit 10421de
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions extension/intents/tabs/tabs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
this.intents.tabs = (function() {
this.intentRunner.registerIntent({
name: "tabs.close",
examples: ["close tab"],
match: `
close tab
close this tab
`,
async run(desc) {
const activeTab = (await browser.tabs.query({ active: true }))[0];
await browser.tabs.remove(activeTab.id);
},
});
})();

0 comments on commit 10421de

Please sign in to comment.