Vivek
Vivek

Reputation: 700

Toolbar icon not being displayed in firefox extension

I am writing a simple Firefox extension which has an icon in the toolbar. I am unable to add the toolbar icon using XUL. My file structure and code I am using is given below:

Extension:

-chrome.manifest
-install.rdf
-chrome
    -content
        -toolbarButton.js
        -toolbarButton.xul
    -locale
    -skin
        -toolbarButton.css
        -icon.png

chrome.manifest:

content myext chrome/content/
skin    myext   classic/1.0 chrome/skin/
locale    myext  en-US       chrome/locale/en-US/

overlay chrome://browser/content/browser.xul  chrome://myext/content/toolbarButton.xul

style chrome://global/content/customizeToolbar.xul chrome://myext/skin/toolbarButton.css
style chrome://global/content/browser.xul chrome://myext/skin/toolbarButton.css

XUL code:

<toolbarpalette id="BrowserToolbarPalette">
    <toolbarbutton id="toolbar-clipper-button"
      label="Some label"
      tooltiptext="Does something"
      oncommand="showMessage(event)" >
    </toolbarbutton>
</toolbarpalette>

CSS code:

#toolbar-clipper-button {
    list-style-image: url("chrome://myext/skin/toolbar-icon.png");
}

Please help me in figuring out the problem.

Upvotes: 1

Views: 850

Answers (1)

Vivek
Vivek

Reputation: 700

I was able to fix the issue with the help of good folks in the mozilla community. Yes, I do not see the toolbar icon in the customize toolbar sheet. The issue was with packaging. All the files were not being copied in my case. The code works fine now...

Upvotes: 1

Related Questions