aboutsummaryrefslogtreecommitdiff
path: root/src/content
diff options
context:
space:
mode:
Diffstat (limited to 'src/content')
-rw-r--r--src/content/index.js13
-rw-r--r--src/content/messages.js4
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',