mirror of
https://codeberg.org/nobody/LocalCDN.git
synced 2025-02-23 15:17:49 +01:00
change browserAction -> action (#1274)
This commit is contained in:
parent
fcf246936f
commit
e2a08d16e7
@ -30,7 +30,7 @@ var wrappers = {};
|
||||
*/
|
||||
|
||||
wrappers.setBadgeBackgroundColor = function (details) {
|
||||
if (chrome.browserAction.setBadgeBackgroundColor === undefined) {
|
||||
if (chrome.action.setBadgeBackgroundColor === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -47,7 +47,7 @@ wrappers.setBadgeBackgroundColor = function (details) {
|
||||
};
|
||||
|
||||
wrappers.setBadgeTextColor = function (details) {
|
||||
if (chrome.browserAction.setBadgeTextColor === undefined) {
|
||||
if (chrome.action.setBadgeTextColor === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -64,8 +64,8 @@ wrappers.setBadgeTextColor = function (details) {
|
||||
};
|
||||
|
||||
wrappers.setBadgeText = function (tabId, text) {
|
||||
if (chrome.browserAction.setBadgeText !== undefined) {
|
||||
chrome.browserAction.setBadgeText({
|
||||
if (chrome.action.setBadgeText !== undefined) {
|
||||
chrome.action.setBadgeText({
|
||||
'tabId': tabId,
|
||||
'text': `${text}`
|
||||
});
|
||||
@ -73,9 +73,9 @@ wrappers.setBadgeText = function (tabId, text) {
|
||||
};
|
||||
|
||||
wrappers.setIcon = function (details, type) {
|
||||
if (chrome.browserAction.setIcon) {
|
||||
if (chrome.action.setIcon) {
|
||||
details.path = IconType[details.path][type];
|
||||
chrome.browserAction.setIcon(details);
|
||||
chrome.action.setIcon(details);
|
||||
}
|
||||
};
|
||||
|
||||
@ -95,15 +95,15 @@ wrappers.setBadgeColoring = function (tabId, value) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (chrome.browserAction.setBadgeTextColor !== undefined) {
|
||||
chrome.browserAction.setBadgeTextColor({
|
||||
if (chrome.action.setBadgeTextColor !== undefined) {
|
||||
chrome.action.setBadgeTextColor({
|
||||
'tabId': tabId,
|
||||
'color': textColor
|
||||
});
|
||||
}
|
||||
|
||||
if (chrome.browserAction.setBadgeBackgroundColor !== undefined) {
|
||||
chrome.browserAction.setBadgeBackgroundColor({
|
||||
if (chrome.action.setBadgeBackgroundColor !== undefined) {
|
||||
chrome.action.setBadgeBackgroundColor({
|
||||
'tabId': tabId,
|
||||
'color': backgroundColor
|
||||
});
|
||||
|
@ -29,7 +29,7 @@ var optionsOther = {};
|
||||
optionsOther._renderIconSection = function (opt) {
|
||||
let url, bgColor, txtColor, selectedIcon;
|
||||
|
||||
if (!chrome.browserAction.setIcon) {
|
||||
if (!chrome.action.setIcon) {
|
||||
document.getElementById('icon-style-div').style.display = 'none';
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user