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

change browserAction -> action (#1274)

This commit is contained in:
nobody
2022-12-29 07:30:05 +01:00
parent fcf246936f
commit e2a08d16e7
2 changed files with 11 additions and 11 deletions

View File

@@ -30,7 +30,7 @@ var wrappers = {};
*/ */
wrappers.setBadgeBackgroundColor = function (details) { wrappers.setBadgeBackgroundColor = function (details) {
if (chrome.browserAction.setBadgeBackgroundColor === undefined) { if (chrome.action.setBadgeBackgroundColor === undefined) {
return; return;
} }
@@ -47,7 +47,7 @@ wrappers.setBadgeBackgroundColor = function (details) {
}; };
wrappers.setBadgeTextColor = function (details) { wrappers.setBadgeTextColor = function (details) {
if (chrome.browserAction.setBadgeTextColor === undefined) { if (chrome.action.setBadgeTextColor === undefined) {
return; return;
} }
@@ -64,8 +64,8 @@ wrappers.setBadgeTextColor = function (details) {
}; };
wrappers.setBadgeText = function (tabId, text) { wrappers.setBadgeText = function (tabId, text) {
if (chrome.browserAction.setBadgeText !== undefined) { if (chrome.action.setBadgeText !== undefined) {
chrome.browserAction.setBadgeText({ chrome.action.setBadgeText({
'tabId': tabId, 'tabId': tabId,
'text': `${text}` 'text': `${text}`
}); });
@@ -73,9 +73,9 @@ wrappers.setBadgeText = function (tabId, text) {
}; };
wrappers.setIcon = function (details, type) { wrappers.setIcon = function (details, type) {
if (chrome.browserAction.setIcon) { if (chrome.action.setIcon) {
details.path = IconType[details.path][type]; details.path = IconType[details.path][type];
chrome.browserAction.setIcon(details); chrome.action.setIcon(details);
} }
}; };
@@ -95,15 +95,15 @@ wrappers.setBadgeColoring = function (tabId, value) {
return; return;
} }
if (chrome.browserAction.setBadgeTextColor !== undefined) { if (chrome.action.setBadgeTextColor !== undefined) {
chrome.browserAction.setBadgeTextColor({ chrome.action.setBadgeTextColor({
'tabId': tabId, 'tabId': tabId,
'color': textColor 'color': textColor
}); });
} }
if (chrome.browserAction.setBadgeBackgroundColor !== undefined) { if (chrome.action.setBadgeBackgroundColor !== undefined) {
chrome.browserAction.setBadgeBackgroundColor({ chrome.action.setBadgeBackgroundColor({
'tabId': tabId, 'tabId': tabId,
'color': backgroundColor 'color': backgroundColor
}); });

View File

@@ -29,7 +29,7 @@ var optionsOther = {};
optionsOther._renderIconSection = function (opt) { optionsOther._renderIconSection = function (opt) {
let url, bgColor, txtColor, selectedIcon; let url, bgColor, txtColor, selectedIcon;
if (!chrome.browserAction.setIcon) { if (!chrome.action.setIcon) {
document.getElementById('icon-style-div').style.display = 'none'; document.getElementById('icon-style-div').style.display = 'none';
return; return;
} }