diff --git a/.eslintrc b/.eslintrc index b703040a33048907fa070f24760dcc76901ff687..5765e85fb1a46c5dc042a2994845e04e4a2be582 100644 --- a/.eslintrc +++ b/.eslintrc @@ -17,7 +17,8 @@ "Setting": true, "stateManager": true, "WebRequest": true, - "Whitelist": true + "Whitelist": true, + "wrappers": true }, "overrides": { "files": [ diff --git a/modules/internal/wrappers.js b/modules/internal/wrappers.js new file mode 100644 index 0000000000000000000000000000000000000000..faf1033a70484c8c4171f133672b216209cb5fec --- /dev/null +++ b/modules/internal/wrappers.js @@ -0,0 +1,38 @@ +/** + * 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); + } +}; diff --git a/pages/background/background.html b/pages/background/background.html index f61861d48437ae778b4ff62e1c200e27186ea047..55584b62d75ef220707cad668e6a4ce21cc82ce9 100644 --- a/pages/background/background.html +++ b/pages/background/background.html @@ -10,6 +10,7 @@ <body> + <script src="../../modules/internal/wrappers.js"></script> <script src="../../modules/internal/helpers.js"></script> <script src="../../core/constants.js"></script>