content commands as action/reducer

This commit is contained in:
Shin'ya Ueoka 2017-09-10 17:51:25 +09:00
parent 2c40d239f0
commit adc6a5175c
6 changed files with 80 additions and 94 deletions

View file

@ -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) => {