diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-10-06 23:55:52 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-10-06 23:55:52 +0900 |
commit | 4cb17031d11d76275de51e31218fb87359e7d826 (patch) | |
tree | 626a976e303458daef90a5a5fac34a5185bc275e /src/content | |
parent | 10ad62e60698c5d53ffcf58ae6abd182f7d3fc9c (diff) |
[wip] remove STATE_UPDATE
Diffstat (limited to 'src/content')
-rw-r--r-- | src/content/index.js | 13 | ||||
-rw-r--r-- | src/content/messages.js | 4 |
2 files changed, 7 insertions, 10 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(); diff --git a/src/content/messages.js b/src/content/messages.js index 72a566b..0e66fa0 100644 --- a/src/content/messages.js +++ b/src/content/messages.js @@ -1,10 +1,12 @@ export default { - STATE_UPDATE: 'state.update', CONTENT_OPERATION: 'content.operation', CONSOLE_BLURRED: 'console.blured', CONSOLE_ENTERED: 'console.entered', CONSOLE_QUERY_COMPLETIONS: 'console.query.completions', + CONSOLE_SHOW_COMMAND: 'console.show.command', + CONSOLE_SHOW_ERROR: 'console.show.error', + CONSOLE_HIDE: 'console.hide', KEYDOWN: 'keydown', |