MCPcopy Create free account
hub / github.com/ClearURLs/Addon / setBadgedStatus

Function setBadgedStatus

core_js/tools.js:197–215  ·  view source on GitHub ↗

* Get the badged status from the browser storage and put the value * into a local variable. *

()

Source from the content-addressed store, hash-verified

195 *
196 */
197function 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.

Callers 1

startFunction · 0.85

Calls 2

checkOSAndroidFunction · 0.85
getBrowserFunction · 0.85

Tested by

no test coverage detected