1
0
mirror of https://codeberg.org/nobody/LocalCDN.git synced 2025-06-05 21:49:31 +02:00

Chromium: Badge color for missing resources (#1031)

This commit is contained in:
nobody
2022-07-22 18:55:48 +02:00
parent 659430da84
commit 465d7d40ea
2 changed files with 14 additions and 13 deletions

View File

@@ -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
});
}
};