Closed
Bug 1422481
Opened 7 years ago
Closed 7 years ago
Browser action icon for WebExtension is missing when moved to overflow menu
Categories
(WebExtensions :: Frontend, defect, P2)
Tracking
(Not tracked)
RESOLVED
INVALID
People
(Reporter: alex, Unassigned)
Details
Attachments
(1 file)
15.78 KB,
image/png
|
Details |
User Agent: Mozilla/5.0 (Windows NT 6.1; rv:58.0) Gecko/20100101 Firefox/58.0
Build ID: 20171115114231
Steps to reproduce:
My WebExtension, Panic Button, allows users to customize the browser action icon by choosing one of several available icons (SVG image files) that are packaged with the add-on. The add-on invokes browser.browserAction.setIcon() to set the custom icon. But this doesn't apply the user's custom icon selection if the browser action button is moved to the overflow ("More Tools") menu.
Steps to Reproduce:
1. Install the Panic Button add-on; current version is 4.0: https://addons.mozilla.org/en-US/firefox/addon/panic-button (requires Firefox 57 or newer)
2. Open the add-on preferences page from Add-ons Manager
3. Select an icon other than the default icon (orange ball with exclamation)
4. Right-click on the Panic Button toolbar button and choose "Pin to Overflow Menu"
Actual results:
The Panic Button browser action button is moved to the overflow menu, but is missing the custom icon.
Expected results:
The custom icon should appear with the Panic Button browser action on the overflow menu.
The following code in the WebExtension is used to set the browser action icon:
function setToolbarButtonIcon(aIconIndex, isReverseContrast)
{
// ...
let toolbarBtnIconName = gToolbarBtnIcons[aIconIndex];
let revContr = isReverseContrast ? "_reverse" : "";
browser.browserAction.setIcon({
path: {
16: `img/${toolbarBtnIconName}16${revContr}.svg`,
32: `img/${toolbarBtnIconName}32${revContr}.svg`
}
}).catch(onError);
}
There were no errors in the browser console when the browser action button was moved to the overflow menu.
I've tried wrapping the image paths inside browser.runtime.getURL(), but that did not have any effect.
Updated•7 years ago
|
Component: Toolbars and Customization → WebExtensions: Frontend
Product: Firefox → Toolkit
Updated•7 years ago
|
Priority: -- → P2
Comment 2•7 years ago
|
||
I can' reproduce this in the latest nightly on OS X. Is this a Windows specific bug?
This issue isn't happening anymore. Turns out it was an issue with my WebExtension referencing a non-existent image file in my add-on.
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → INVALID
Updated•7 years ago
|
Product: Toolkit → WebExtensions
You need to log in
before you can comment on or make changes to this bug.
Description
•