1
0
mirror of https://codeberg.org/nobody/LocalCDN.git synced 2024-12-17 13:49:32 +01:00
LocalCDN-Firefox-Chrome-Brave/modules/internal/wrappers.js
2020-08-13 08:07:04 +02:00

52 lines
1.2 KiB
JavaScript

/**
* Internal API Wrapper Module
* Belongs to Decentraleyes.
*
* @author Thomas Rientjes
* @since 2017-12-03
* @license MPL 2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
'use strict';
/**
* Wrappers
*/
var wrappers = {};
/**
* Public Methods
*/
wrappers.setBadgeBackgroundColor = function (details) {
if (chrome.browserAction.setBadgeBackgroundColor !== undefined) {
chrome.browserAction.setBadgeBackgroundColor(details);
}
};
wrappers.setBadgeText = function (details) {
if (chrome.browserAction.setBadgeText !== undefined) {
chrome.browserAction.setBadgeText(details);
}
};
wrappers.setBadgeTextColor = function (details) {
if (chrome.browserAction.setBadgeTextColor !== undefined) {
chrome.browserAction.setBadgeTextColor(details);
}
};
wrappers.setIcon = function (details, type) {
if (chrome.browserAction.setIcon) {
details.path = IconType[details.path][type];
} else {
details.path = IconType['Default'][type];
}
chrome.browserAction.setIcon(details);
};