aboutsummaryrefslogtreecommitdiff
path: root/src/content/components/top-content/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/components/top-content/index.js')
-rw-r--r--src/content/components/top-content/index.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/content/components/top-content/index.js b/src/content/components/top-content/index.js
index cf21ec4..a0d0480 100644
--- a/src/content/components/top-content/index.js
+++ b/src/content/components/top-content/index.js
@@ -44,15 +44,24 @@ export default class TopContent {
.some(regex => regex.test(partial));
if (matched) {
this.store.dispatch(addonActions.disable());
+ } else {
+ this.store.dispatch(addonActions.enable());
}
}
onMessage(message) {
+ let addonState = this.store.getState().addon;
+
switch (message.type) {
case messages.CONSOLE_UNFOCUS:
this.win.focus();
consoleFrames.blur(window.document);
return Promise.resolve();
+ case messages.ADDON_ENABLED_QUERY:
+ return Promise.resolve({
+ type: messages.ADDON_ENABLED_RESPONSE,
+ enabled: addonState.enabled,
+ });
}
}
}