aboutsummaryrefslogtreecommitdiff
path: root/src/content
diff options
context:
space:
mode:
Diffstat (limited to 'src/content')
-rw-r--r--src/content/actions/follow-controller.js3
-rw-r--r--src/content/actions/operation.js3
-rw-r--r--src/content/components/common/follow.js8
-rw-r--r--src/content/components/top-content/follow-controller.js3
-rw-r--r--src/content/reducers/follow-controller.js2
5 files changed, 14 insertions, 5 deletions
diff --git a/src/content/actions/follow-controller.js b/src/content/actions/follow-controller.js
index 3fd4dce..006b248 100644
--- a/src/content/actions/follow-controller.js
+++ b/src/content/actions/follow-controller.js
@@ -1,9 +1,10 @@
import actions from 'content/actions';
-const enable = (newTab) => {
+const enable = (newTab, background) => {
return {
type: actions.FOLLOW_CONTROLLER_ENABLE,
newTab,
+ background,
};
};
diff --git a/src/content/actions/operation.js b/src/content/actions/operation.js
index 71b2470..9171766 100644
--- a/src/content/actions/operation.js
+++ b/src/content/actions/operation.js
@@ -44,7 +44,8 @@ const exec = (operation, repeat, settings) => {
case operations.FOLLOW_START:
return window.top.postMessage(JSON.stringify({
type: messages.FOLLOW_START,
- newTab: operation.newTab
+ newTab: operation.newTab,
+ background: operation.background,
}), '*');
case operations.NAVIGATE_HISTORY_PREV:
return navigates.historyPrev(window);
diff --git a/src/content/components/common/follow.js b/src/content/components/common/follow.js
index a8682c5..2a55ea3 100644
--- a/src/content/components/common/follow.js
+++ b/src/content/components/common/follow.js
@@ -50,6 +50,7 @@ export default class Follow {
this.win = win;
this.store = store;
this.newTab = false;
+ this.background = false;
this.hints = {};
this.targets = [];
@@ -85,6 +86,7 @@ export default class Follow {
type: messages.OPEN_URL,
url: element.href,
newTab: true,
+ background: this.background,
});
}
@@ -96,12 +98,13 @@ export default class Follow {
}), '*');
}
- createHints(keysArray, newTab) {
+ createHints(keysArray, newTab, background) {
if (keysArray.length !== this.targets.length) {
throw new Error('illegal hint count');
}
this.newTab = newTab;
+ this.background = background;
this.hints = {};
for (let i = 0; i < keysArray.length; ++i) {
let keys = keysArray[i];
@@ -167,7 +170,8 @@ export default class Follow {
case messages.FOLLOW_REQUEST_COUNT_TARGETS:
return this.countHints(sender, message.viewSize, message.framePosition);
case messages.FOLLOW_CREATE_HINTS:
- return this.createHints(message.keysArray, message.newTab);
+ return this.createHints(
+ message.keysArray, message.newTab, message.background);
case messages.FOLLOW_SHOW_HINTS:
return this.showHints(message.keys);
case messages.FOLLOW_ACTIVATE:
diff --git a/src/content/components/top-content/follow-controller.js b/src/content/components/top-content/follow-controller.js
index 1b5586b..7f36604 100644
--- a/src/content/components/top-content/follow-controller.js
+++ b/src/content/components/top-content/follow-controller.js
@@ -28,7 +28,7 @@ export default class FollowController {
switch (message.type) {
case messages.FOLLOW_START:
return this.store.dispatch(
- followControllerActions.enable(message.newTab));
+ followControllerActions.enable(message.newTab, message.background));
case messages.FOLLOW_RESPONSE_COUNT_TARGETS:
return this.create(message.count, sender);
case messages.FOLLOW_KEY_PRESS:
@@ -129,6 +129,7 @@ export default class FollowController {
type: messages.FOLLOW_CREATE_HINTS,
keysArray: produced,
newTab: this.state.newTab,
+ background: this.state.background,
}), '*');
}
diff --git a/src/content/reducers/follow-controller.js b/src/content/reducers/follow-controller.js
index 2afb232..78fd848 100644
--- a/src/content/reducers/follow-controller.js
+++ b/src/content/reducers/follow-controller.js
@@ -3,6 +3,7 @@ import actions from 'content/actions';
const defaultState = {
enabled: false,
newTab: false,
+ background: false,
keys: '',
};
@@ -12,6 +13,7 @@ export default function reducer(state = defaultState, action = {}) {
return Object.assign({}, state, {
enabled: true,
newTab: action.newTab,
+ background: action.background,
keys: '',
});
case actions.FOLLOW_CONTROLLER_DISABLE: