aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrobsmith11 <robsmith11@yandex.com>2019-05-17 14:51:04 +0000
committerrobsmith11 <robsmith11@yandex.com>2019-05-17 14:51:04 +0000
commitf60961947fc9471024081c3c76f940b864336e5f (patch)
treeeade267223da8b8d9bd7dd4ad36558c41911aac4
parent05ef6a8ca35aaa801c11eb6b4896caa3690058af (diff)
Fix setIcon warning on Android
-rw-r--r--src/background/presenters/IndicatorPresenter.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/background/presenters/IndicatorPresenter.ts b/src/background/presenters/IndicatorPresenter.ts
index d9a615a..5d9c21f 100644
--- a/src/background/presenters/IndicatorPresenter.ts
+++ b/src/background/presenters/IndicatorPresenter.ts
@@ -3,7 +3,13 @@ export default class IndicatorPresenter {
let path = enabled
? 'resources/enabled_32x32.png'
: 'resources/disabled_32x32.png';
- return browser.browserAction.setIcon({ path });
+ if (typeof browser.browserAction.setIcon === "function") {
+ return browser.browserAction.setIcon({ path });
+ }
+ else {
+ // setIcon not supported on Android
+ return Promise.resolve();
+ }
}
onClick(listener: (arg: browser.tabs.Tab) => void): void {