({isActive = this.iconState.active, colorScheme = 'dark', tabId}: IconOptions)
| 66 | } |
| 67 | |
| 68 | static setIcon({isActive = this.iconState.active, colorScheme = 'dark', tabId}: IconOptions): void { |
| 69 | if (__THUNDERBIRD__ || !chrome.browserAction.setIcon) { |
| 70 | // Fix for Firefox Android and Thunderbird. |
| 71 | return; |
| 72 | } |
| 73 | // Temporary disable per-site icons |
| 74 | // eslint-disable-next-line no-empty |
| 75 | if (colorScheme === 'dark') { |
| 76 | } |
| 77 | if (tabId) { |
| 78 | return; |
| 79 | } |
| 80 | |
| 81 | this.iconState.active = isActive; |
| 82 | |
| 83 | let path = this.ICON_PATHS.activeDark; |
| 84 | if (isActive) { |
| 85 | // Temporary disable the gray icon |
| 86 | // path = colorScheme === 'dark' ? IconManager.ICON_PATHS.activeDark : IconManager.ICON_PATHS.activeLight; |
| 87 | path = IconManager.ICON_PATHS.activeDark; |
| 88 | } else { |
| 89 | // Temporary disable the gray icon |
| 90 | // path = colorScheme === 'dark' ? IconManager.ICON_PATHS.inactiveDark : IconManager.ICON_PATHS.inactiveLight; |
| 91 | path = IconManager.ICON_PATHS.activeLight; |
| 92 | } |
| 93 | |
| 94 | // Temporary disable per-site icons |
| 95 | /* |
| 96 | if (tabId) { |
| 97 | chrome.browserAction.setIcon({tabId, path}); |
| 98 | } else { |
| 99 | chrome.browserAction.setIcon({path}); |
| 100 | IconManager.handleUpdate(); |
| 101 | } |
| 102 | */ |
| 103 | chrome.browserAction.setIcon({path}); |
| 104 | IconManager.handleUpdate(); |
| 105 | } |
| 106 | |
| 107 | static showBadge(text: string): void { |
| 108 | IconManager.iconState.badgeText = text; |
no test coverage detected