diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-10-08 15:25:56 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-10-08 15:25:56 +0900 |
commit | 940f3c7f791b38262563dc05a905b8f7caabf769 (patch) | |
tree | 5a502143c5d8d62991eee4978c07467a821377a7 | |
parent | 0183161145d36cbafb7dbd86ca3a1aac6faca43f (diff) |
support winopen command
-rw-r--r-- | src/shared/commands.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/shared/commands.js b/src/shared/commands.js index b1d8780..2d95e84 100644 --- a/src/shared/commands.js +++ b/src/shared/commands.js @@ -36,6 +36,10 @@ const tabopenCommand = (url) => { return browser.tabs.create({ url: url }); }; +const winopenCommand = (url) => { + return browser.windows.create({ url }); +}; + const bufferCommand = (keywords) => { return browser.tabs.query({ active: true, currentWindow: true @@ -87,11 +91,13 @@ const doCommand = (name, remaining, settings) => { switch (name) { case 'o': case 'open': - // TODO use search engined and pass keywords to them return openCommand(normalizeUrl(remaining, settings.search)); case 't': case 'tabopen': return tabopenCommand(normalizeUrl(remaining, settings.search)); + case 'w': + case 'winopen': + return winopenCommand(normalizeUrl(remaining, settings.search)); case 'b': case 'buffer': return bufferCommand(remaining); @@ -105,6 +111,8 @@ const getCompletions = (command, keywords, settings) => { case 'open': case 't': case 'tabopen': + case 'w': + case 'winopen': return getOpenCompletions(command, keywords, settings.search); case 'b': case 'buffer': |