From 465d7d40eac03cd8dc0eebca84412309d32a7fbf Mon Sep 17 00:00:00 2001 From: nobody Date: Fri, 22 Jul 2022 18:55:48 +0200 Subject: [PATCH] Chromium: Badge color for missing resources (#1031) --- modules/internal/wrappers.js | 26 +++++++++++++------------- pages/updates/updates.html | 1 + 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/modules/internal/wrappers.js b/modules/internal/wrappers.js index 6ab21139..2b422f42 100644 --- a/modules/internal/wrappers.js +++ b/modules/internal/wrappers.js @@ -82,11 +82,6 @@ wrappers.setIcon = function (details, type) { wrappers.setBadgeColoring = function (tabId, value) { let textColor, backgroundColor; - if (chrome.browserAction.setBadgeBackgroundColor === undefined || - chrome.browserAction.setBadgeTextColor === undefined) { - return; - } - if (value === BadgeSettingHTMLFilter.TYPE) { textColor = wrappers.badgeHTMLfilterTextColor; backgroundColor = wrappers.badgeHTMLFilterBackgroundColor; @@ -100,12 +95,17 @@ wrappers.setBadgeColoring = function (tabId, value) { return; } - chrome.browserAction.setBadgeTextColor({ - 'tabId': tabId, - 'color': textColor - }); - chrome.browserAction.setBadgeBackgroundColor({ - 'tabId': tabId, - 'color': backgroundColor - }); + if (chrome.browserAction.setBadgeTextColor !== undefined) { + chrome.browserAction.setBadgeTextColor({ + 'tabId': tabId, + 'color': textColor + }); + } + + if (chrome.browserAction.setBadgeBackgroundColor !== undefined) { + chrome.browserAction.setBadgeBackgroundColor({ + 'tabId': tabId, + 'color': backgroundColor + }); + } }; diff --git a/pages/updates/updates.html b/pages/updates/updates.html index 39e09168..0caadd63 100644 --- a/pages/updates/updates.html +++ b/pages/updates/updates.html @@ -58,6 +58,7 @@

Removed