aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2018-02-25 08:41:51 +0000
committerGitHub <noreply@github.com>2018-02-25 08:41:51 +0000
commit2fd6a3f90fe2c910aaa14556b0d55da4070aba85 (patch)
treed2ecec6c48c6cd28d24a0b1c2c95cc3422b8eea1
parentd0e4fc92ce678fdb18fc27a9810f7fb1c8b8a8f5 (diff)
parent21c7320bcfd9cf881ba5aa98b9640e8c8c068d16 (diff)
Merge pull request #347 from ueokande/set-tab-opener
Set opener tab id
-rw-r--r--e2e/contents/zoom.test.js2
-rw-r--r--src/background/actions/tab.js4
-rw-r--r--src/background/components/background.js2
3 files changed, 4 insertions, 4 deletions
diff --git a/e2e/contents/zoom.test.js b/e2e/contents/zoom.test.js
index c2e787f..603e0b6 100644
--- a/e2e/contents/zoom.test.js
+++ b/e2e/contents/zoom.test.js
@@ -5,7 +5,7 @@ import * as keys from "../ambassador/src/client/keys";
const SERVER_URL = "localhost:11111/";
-describe("tab test", () => {
+describe("zoom test", () => {
let targetWindow;
let targetTab;
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);