diff options
Diffstat (limited to 'src/background/presenters')
-rw-r--r-- | src/background/presenters/tab.js | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/background/presenters/tab.js b/src/background/presenters/tab.js index 6120f6e..66a207f 100644 --- a/src/background/presenters/tab.js +++ b/src/background/presenters/tab.js @@ -1,6 +1,22 @@ export default class TabPresenter { - create(url) { - browser.tabs.create({ url, }); + open(url, tabId) { + return browser.tabs.update(tabId, { url }); + } + + create(url, { openerTabId, active }) { + return browser.tabs.create({ url, openerTabId, active }); + } + + async createAdjacent(url, { openerTabId, active }) { + let tabs = await browser.tabs.query({ + active: true, currentWindow: true + }); + return browser.tabs.create({ + url, + openerTabId, + active, + index: tabs[0].index + 1 + }); } onSelected(listener) { |