|
|
@ -3,8 +3,14 @@ export default class IndicatorPresenter { |
|
|
|
let path = enabled |
|
|
|
let path = enabled |
|
|
|
? 'resources/enabled_32x32.png' |
|
|
|
? 'resources/enabled_32x32.png' |
|
|
|
: 'resources/disabled_32x32.png'; |
|
|
|
: 'resources/disabled_32x32.png'; |
|
|
|
|
|
|
|
if (typeof browser.browserAction.setIcon === "function") { |
|
|
|
return browser.browserAction.setIcon({ path }); |
|
|
|
return browser.browserAction.setIcon({ path }); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
// setIcon not supported on Android
|
|
|
|
|
|
|
|
return Promise.resolve(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
onClick(listener: (arg: browser.tabs.Tab) => void): void { |
|
|
|
onClick(listener: (arg: browser.tabs.Tab) => void): void { |
|
|
|
browser.browserAction.onClicked.addListener(listener); |
|
|
|
browser.browserAction.onClicked.addListener(listener); |
|
|
|