MCPcopy Index your code
hub / github.com/darkreader/darkreader / handleUpdate

Method handleUpdate

src/background/icon-manager.ts:57–66  ·  view source on GitHub ↗

* This method registers onStartup listener only if we are in non-persistent world and * icon is in non-default configuration.

()

Source from the content-addressed store, hash-verified

55 * icon is in non-default configuration.
56 */
57 private static handleUpdate() {
58 if (!isNonPersistent) {
59 return;
60 }
61 if (IconManager.iconState.badgeText !== '' || !IconManager.iconState.active) {
62 chrome.runtime.onStartup.addListener(IconManager.onStartup);
63 } else {
64 chrome.runtime.onStartup.removeListener(IconManager.onStartup);
65 }
66 }
67
68 static setIcon({isActive = this.iconState.active, colorScheme = 'dark', tabId}: IconOptions): void {
69 if (__THUNDERBIRD__ || !chrome.browserAction.setIcon) {

Callers 3

setIconMethod · 0.80
showBadgeMethod · 0.80
hideBadgeMethod · 0.80

Calls 1

addListenerMethod · 0.45

Tested by

no test coverage detected