|
|
@ -17,6 +17,12 @@ const tabopenCommand = (url) => { |
|
|
|
return browser.tabs.create({ url: 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) => { |
|
|
|
const winopenCommand = (url) => { |
|
|
|
return browser.windows.create({ url }); |
|
|
|
return browser.windows.create({ url }); |
|
|
|
}; |
|
|
|
}; |
|
|
@ -70,6 +76,9 @@ const exec = (line, settings) => { |
|
|
|
return bufferCommand(args); |
|
|
|
return bufferCommand(args); |
|
|
|
case 'set': |
|
|
|
case 'set': |
|
|
|
return setCommand(args); |
|
|
|
return setCommand(args); |
|
|
|
|
|
|
|
case 'q': |
|
|
|
|
|
|
|
case 'quit': |
|
|
|
|
|
|
|
return tabcloseCommand(); |
|
|
|
case '': |
|
|
|
case '': |
|
|
|
return Promise.resolve(); |
|
|
|
return Promise.resolve(); |
|
|
|
} |
|
|
|
} |
|
|
|