aboutsummaryrefslogtreecommitdiff
path: root/src/background/components/indicator.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/background/components/indicator.js')
-rw-r--r--src/background/components/indicator.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/background/components/indicator.js b/src/background/components/indicator.js
index ccdcc74..cceb119 100644
--- a/src/background/components/indicator.js
+++ b/src/background/components/indicator.js
@@ -7,6 +7,7 @@ export default class IndicatorComponent {
messages.onMessage(this.onMessage.bind(this));
+ browser.browserAction.onClicked.addListener(this.onClicked);
browser.tabs.onActivated.addListener((info) => {
return browser.tabs.query({ currentWindow: true }).then(() => {
return this.onTabActivated(info);
@@ -22,6 +23,12 @@ export default class IndicatorComponent {
});
}
+ onClicked(tab) {
+ browser.tabs.sendMessage(tab.id, {
+ type: messages.ADDON_TOGGLE_ENABLED,
+ });
+ }
+
onMessage(message) {
switch (message.type) {
case messages.ADDON_ENABLED_RESPONSE: