Created
April 13, 2016 11:51
-
-
Save rpl/3a358c12726f51be8d0a56b9cb139efd to your computer and use it in GitHub Desktop.
resolve addon icon url
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/toolkit/mozapps/extensions/internal/XPIProvider.jsm b/toolkit/mozapps/extensions/internal/XPIProvider.jsm | |
--- a/toolkit/mozapps/extensions/internal/XPIProvider.jsm | |
+++ b/toolkit/mozapps/extensions/internal/XPIProvider.jsm | |
@@ -6990,22 +6990,23 @@ AddonWrapper.prototype = { | |
icons[32] = icons[48] = this.getResourceURI("icon.png").spec; | |
} | |
if (this.hasResource("icon64.png")) { | |
icons[64] = this.getResourceURI("icon64.png").spec; | |
} | |
} | |
if(this.isActive && addon.iconURL){ | |
- icons[32] = addon.iconURL; | |
- icons[48] = addon.iconURL; | |
+ icons[32] = icons[48] = addon.iconURL.indexOf("://") >= 0 ? | |
+ addon.iconURL : this.getResourceURI(addon.iconURL).spec; | |
} | |
if(this.isActive && addon.icon64URL){ | |
- icons[64] = addon.icon64URL; | |
+ icons[64] = addon.iconURL.indexOf("://") >= 0 ? | |
+ addon.icon64URL : this.getResourceURI(addon.icon64URL).spec; | |
} | |
Object.freeze(icons); | |
return icons; | |
}, | |
get screenshots() { | |
let addon = addonFor(this); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment