summaryrefslogtreecommitdiffstats
path: root/browser/components/extensions/ext-browserAction.js
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-02-02 20:51:18 +0100
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-02-02 20:51:18 +0100
commitf3aeeab64f6a5ae0639805b2c71e13323258e2c1 (patch)
tree587f41772c47f6661815ae7f8dec6a3e49389bde /browser/components/extensions/ext-browserAction.js
parent9627f18cebab38cdfe45592d83371ee7bbc62cfa (diff)
downloadUXP-f3aeeab64f6a5ae0639805b2c71e13323258e2c1.tar
UXP-f3aeeab64f6a5ae0639805b2c71e13323258e2c1.tar.gz
UXP-f3aeeab64f6a5ae0639805b2c71e13323258e2c1.tar.lz
UXP-f3aeeab64f6a5ae0639805b2c71e13323258e2c1.tar.xz
UXP-f3aeeab64f6a5ae0639805b2c71e13323258e2c1.zip
Support for css-color-4 (finish)
Issue #4
Diffstat (limited to 'browser/components/extensions/ext-browserAction.js')
-rw-r--r--browser/components/extensions/ext-browserAction.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/browser/components/extensions/ext-browserAction.js b/browser/components/extensions/ext-browserAction.js
index 97c6fd22c..407366e2c 100644
--- a/browser/components/extensions/ext-browserAction.js
+++ b/browser/components/extensions/ext-browserAction.js
@@ -9,9 +9,9 @@ XPCOMUtils.defineLazyModuleGetter(this, "clearTimeout",
XPCOMUtils.defineLazyModuleGetter(this, "setTimeout",
"resource://gre/modules/Timer.jsm");
-XPCOMUtils.defineLazyGetter(this, "colorUtils", () => {
- return require("devtools/shared/css/color").colorUtils;
-});
+XPCOMUtils.defineLazyServiceGetter(this, "DOMUtils",
+ "@mozilla.org/inspector/dom-utils;1",
+ "inIDOMUtils");
Cu.import("resource://devtools/shared/event-emitter.js");
Cu.import("resource://gre/modules/ExtensionUtils.jsm");
@@ -511,7 +511,7 @@ extensions.registerSchemaAPI("browserAction", "addon_parent", context => {
let tab = details.tabId !== null ? TabManager.getTab(details.tabId, context) : null;
let color = details.color;
if (!Array.isArray(color)) {
- let col = colorUtils.colorToRGBA(color);
+ let col = DOMUtils.colorToRGBA(color);
color = col && [col.r, col.g, col.b, Math.round(col.a * 255)];
}
BrowserAction.for(extension).setProperty(tab, "badgeBackgroundColor", color);