aboutsummaryrefslogtreecommitdiff
path: root/src/content/index.js
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2017-10-06 23:55:52 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2017-10-06 23:55:52 +0900
commit4cb17031d11d76275de51e31218fb87359e7d826 (patch)
tree626a976e303458daef90a5a5fac34a5185bc275e /src/content/index.js
parent10ad62e60698c5d53ffcf58ae6abd182f7d3fc9c (diff)
[wip] remove STATE_UPDATE
Diffstat (limited to 'src/content/index.js')
-rw-r--r--src/content/index.js13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/content/index.js b/src/content/index.js
index 31b37cf..b29118d 100644
--- a/src/content/index.js
+++ b/src/content/index.js
@@ -55,17 +55,12 @@ const execOperation = (operation) => {
}
};
-const update = (state) => {
- if (!state.console.commandShown) {
- window.focus();
- consoleFrames.blur(window.document);
- }
-};
-
browser.runtime.onMessage.addListener((action) => {
switch (action.type) {
- case messages.STATE_UPDATE:
- return update(action.state);
+ case messages.CONSOLE_HIDE:
+ window.focus();
+ consoleFrames.blur(window.document);
+ return Promise.resolve();
case messages.CONTENT_OPERATION:
execOperation(action.operation);
return Promise.resolve();