* Get the badged status from the browser storage and put the value * into a local variable. *
()
| 195 | * |
| 196 | */ |
| 197 | function setBadgedStatus() { |
| 198 | checkOSAndroid().then((res) => { |
| 199 | if (!res && storage.badgedStatus) { |
| 200 | let color = storage.badged_color; |
| 201 | if (storage.badged_color.charAt(0) !== '#') |
| 202 | color = '#' + storage.badged_color; |
| 203 | browser.browserAction.setBadgeBackgroundColor({ |
| 204 | 'color': color |
| 205 | }).catch(handleError); |
| 206 | |
| 207 | // Works only in Firefox: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/browserAction/setBadgeTextColor#Browser_compatibility |
| 208 | if (getBrowser() === "Firefox") { |
| 209 | browser.browserAction.setBadgeTextColor({ |
| 210 | color: "#FFFFFF" |
| 211 | }).catch(handleError); |
| 212 | } |
| 213 | } |
| 214 | }); |
| 215 | } |
| 216 | |
| 217 | /** |
| 218 | * Returns the current URL. |
no test coverage detected