mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-10 02:08:38 +09:00
parent
c3a7fd56e7
commit
a7474395ec
9 changed files with 90 additions and 32 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue