Icon for browser_action

Hi !

I’m porting a Chrome extension to Firefox using the new WebExtensions API. I’m encountering an issue regarding the browser_action feature: I don’t see any icon in the toolbar when importing the extension.
It seems everything is alright. However, even the extension itself does not have its icon.

How browser_action icon is supposed to work ? Is it restricted on some format?

Here’s the manifest I’m using:

{
    "manifest_version": 2,
    "name": "My Extension",
    "description": "Super ext",
    "homepage_url": "https:\/\/example.com",
    "author": "example",
    "icons": {
        "16": "img\/icon16.png",
        "48": "img\/icon48.png",
        "128": "img\/icon128.png"
    },
    "browser_action": {
        "default_title": "Extension - dev",
        "default_icon": "img\/icon16.png",
        "icon": "img\/icon16.png",
        "default_popup": "main.html"
    },
    "version": "1.1.3",
    "applications": {
        "gecko": {
            "id": "extension@example.com"
        }
    }
}

Of course, png’s and main.html do exist :slight_smile:

Adding @billm.

For the record, I’m using nightly 43.0a1 (2015-08-31)

It’s possible you’re running into bug 1199842. To confirm that:

  • try removing the default_popup line from manifest.json, and see if it works then

  • look at the output of the Browser Console when you install the extension: if it logs something like this:

    [CustomizableUI] Custom widget with id extension_example_com-browser-action does not return a valid node CustomizableUI.jsm:166
    [CustomizableUI] Widget ‘extension_example_com-browser-action’ not found, unable to move CustomizableUI.jsm:166
    XUL_NS is not defined

…then bug 1199842 is probably the problem.