diff options
Diffstat (limited to 'src/background')
-rw-r--r-- | src/background/index.js | 7 | ||||
-rw-r--r-- | src/background/key-queue.js | 21 |
2 files changed, 12 insertions, 16 deletions
diff --git a/src/background/index.js b/src/background/index.js index cb7a3ff..3fa8553 100644 --- a/src/background/index.js +++ b/src/background/index.js @@ -1,4 +1,3 @@ -import * as actions from '../shared/actions'; import * as tabs from './tabs'; import KeyQueue from './key-queue'; import backgroundReducers from '../reducers/background'; @@ -14,11 +13,9 @@ const keyPressHandle = (request, sender) => { return Promise.resolve(); } - if (actions.isContentAction(action.type)) { + return backgroundReducers(undefined, action, sender).then(() => { return browser.tabs.sendMessage(sender.tab.id, action); - } else { - return backgroundReducers(undefined, action, sender); - } + }); }; const normalizeUrl = (string) => { diff --git a/src/background/key-queue.js b/src/background/key-queue.js index 25f1d24..924bf77 100644 --- a/src/background/key-queue.js +++ b/src/background/key-queue.js @@ -1,5 +1,4 @@ -import newActions from '../actions'; -import * as actions from '../shared/actions'; +import actions from '../actions'; const DEFAULT_KEYMAP = { ':': { type: actions.CMD_OPEN }, @@ -18,15 +17,15 @@ const DEFAULT_KEYMAP = { 'G': { type: actions.SCROLL_BOTTOM }, '0': { type: actions.SCROLL_LEFT }, '$': { type: actions.SCROLL_RIGHT }, - 'd': { type: newActions.TABS_CLOSE }, - 'u': { type: newActions.TABS_REOPEN }, - 'h': { type: newActions.TABS_PREV, count: 1 }, - 'l': { type: newActions.TABS_NEXT, count: 1 }, - 'r': { type: newActions.TABS_RELOAD, cache: false }, - 'R': { type: newActions.TABS_RELOAD, cache: true }, - 'zi': { type: newActions.ZOOM_IN }, - 'zo': { type: newActions.ZOOM_OUT }, - 'zz': { type: newActions.ZOOM_NEUTRAL }, + 'd': { type: actions.TABS_CLOSE }, + 'u': { type: actions.TABS_REOPEN }, + 'h': { type: actions.TABS_PREV, count: 1 }, + 'l': { type: actions.TABS_NEXT, count: 1 }, + 'r': { type: actions.TABS_RELOAD, cache: false }, + 'R': { type: actions.TABS_RELOAD, cache: true }, + 'zi': { type: actions.ZOOM_IN }, + 'zo': { type: actions.ZOOM_OUT }, + 'zz': { type: actions.ZOOM_NEUTRAL }, 'f': { type: actions.FOLLOW_START, newTab: false }, 'F': { type: actions.FOLLOW_START, newTab: true }, 'H': { type: actions.HISTORY_PREV }, |