From ba2cd311e158152d961e39f84f29fefc872cc594 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Tue, 20 Feb 2018 21:09:05 +0900 Subject: [PATCH] set opener tab id --- src/background/actions/tab.js | 4 ++-- src/background/components/background.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/background/actions/tab.js b/src/background/actions/tab.js index e512b6f..40da55d 100644 --- a/src/background/actions/tab.js +++ b/src/background/actions/tab.js @@ -1,5 +1,5 @@ -const openNewTab = (url) => { - return browser.tabs.create({ url: url }); +const openNewTab = (url, openerTabId) => { + return browser.tabs.create({ url, openerTabId }); }; const openToTab = (url, tab) => { diff --git a/src/background/components/background.js b/src/background/components/background.js index 9578e78..c4f436a 100644 --- a/src/background/components/background.js +++ b/src/background/components/background.js @@ -31,7 +31,7 @@ export default class BackgroundComponent { case messages.OPEN_URL: if (message.newTab) { return this.store.dispatch( - tabActions.openNewTab(message.url), sender); + tabActions.openNewTab(message.url, sender.tab.id), sender); } return this.store.dispatch( tabActions.openToTab(message.url, sender.tab), sender);