Closed
Bug 1119890
Opened 10 years ago
Closed 8 years ago
Provide a way for PageActions.jsm to specify multiple icons sizes
Categories
(Firefox for Android Graveyard :: General, defect)
Tracking
(Not tracked)
RESOLVED
DUPLICATE
of bug 1270742
People
(Reporter: mkaply, Unassigned, Mentored)
Details
(Keywords: dev-doc-needed, Whiteboard: [lang=js])
Currently the PageActions add API takes one icon parameter. It's up to the caller to determine the proper icon to pass to the API based on the screen resolution. We should allow multiple sizes to be passed, like: icon64: '64.png", icon128: "icon128.png", etc. and then the PageActions jsm would use the proper icon. See: https://github.com/leibovic/fennec_rss/blob/master/bootstrap.js#L344 for examples.
Reporter | ||
Comment 1•10 years ago
|
||
Also see: https://bugzilla.mozilla.org/show_bug.cgi?id=993698
Updated•10 years ago
|
Mentor: margaret.leibovic, wjohnston
OS: Mac OS X → Android
Hardware: x86 → All
Whiteboard: [lang=js]
Comment 2•10 years ago
|
||
We're just begging for a more uniform way to expose multiple icon sizes/densities across all of our JSM APIs.
Keywords: dev-doc-needed
Reporter | ||
Comment 3•10 years ago
|
||
See chrome's implementation as well: https://developer.chrome.com/extensions/manifest/icons
Comment 6•8 years ago
|
||
Once bug 1270742 lands, we'll be able to use ExtensionUtils.jsm to do this. I'm moving the relevant code that desktop uses (found in ext-utils.js) into ExtensionUtils.jsm, and then making some additions/modifications so Android can also use it. This is the code for how I'm using IconDetails with PageActions.jsm in ext-pageAction.js: this.icons = IconDetails.normalize({path: options.default_icon}, extension); ... let {icon} = IconDetails.getURL(this.icons, context.contentWindow, this.extension, 18); let browserWindow = Services.wm.getMostRecentWindow("navigator:browser"); return IconDetails.convertImageURLToDataURL(icon, context, browserWindow).then(dataURI => { let options = { icon = dataURI, ... } let id = PageActions.add(this.options); ... } }); Let me know if you have any questions. I think we can close this bug once bug 1270742 lands.
No longer blocks: webext-android, 1263005
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
Comment 7•8 years ago
|
||
I meant to undo marking this bug as a duplicate before submitting my commit but I forgot to. If there aren't any objections, however, I'm going to leave it marked that way.
Assignee | ||
Updated•4 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•