set opener tab id

jh-changes
Shin'ya Ueoka 7 years ago
parent d0e4fc92ce
commit ba2cd311e1
  1. 4
      src/background/actions/tab.js
  2. 2
      src/background/components/background.js

@ -1,5 +1,5 @@
const openNewTab = (url) => { const openNewTab = (url, openerTabId) => {
return browser.tabs.create({ url: url }); return browser.tabs.create({ url, openerTabId });
}; };
const openToTab = (url, tab) => { const openToTab = (url, tab) => {

@ -31,7 +31,7 @@ export default class BackgroundComponent {
case messages.OPEN_URL: case messages.OPEN_URL:
if (message.newTab) { if (message.newTab) {
return this.store.dispatch( return this.store.dispatch(
tabActions.openNewTab(message.url), sender); tabActions.openNewTab(message.url, sender.tab.id), sender);
} }
return this.store.dispatch( return this.store.dispatch(
tabActions.openToTab(message.url, sender.tab), sender); tabActions.openToTab(message.url, sender.tab), sender);