Reputation: 100322
I am trying to add a button on the Customize Tool Window on Firefox 4
My folders look like this:
addon
|- content
|- om
|- xul
|- browser.xul
|- browser.css
|- skin
|- default
|- icon.png
My chrome.manifest
file:
content orkutmanager content/om/
content orkutmanager content/om/ contentaccessible=yes
skin orkutmanager default skin/default/
locale orkutmanager en-US locale/en-US/
overlay chrome://global/content/browser.xul chrome://orkutmanager/content/xul/browser.xul
My browser.xul
file:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="chrome://orkutmanager/content/xul/browser.css"?>
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<toolbarpalette id="BrowserToolbarPalette">
<toolbarbutton id="orkutmanager-button" label="OM"
class="toolbarbutton-1 chromeclass-toolbar-additional"
tooltiptext="Orkut Manager"/>
</toolbarpalette>
</overlay>
Accessing chrome://orkutmanager/content/xul/browser.xul
gets me to a blank page, which means the file was found. (Should something be rendered?).
Accessing chrome://global/content/browser.xul
gets me to an error page:
Firefox can't find the file at jar:file:///C:/Program Files (x86)/Mozilla Firefox 4.0 Beta 7/omni.jar!/chrome/toolkit/content/global/browser.xul
Isn't this file supposed to exist? Did it move? How can I add an icon on the Customize Toolbar window?
Upvotes: 3
Views: 938
Reputation: 16025
Apparently I should post this as an answer for accepting:
http://forums.mozillazine.org/viewtopic.php?f=38&t=934345
seems to demonstrate roughly the problem you are looking at. However, you commented that this was not correct entirely, but that it did lead to you finding the problem which was the inclusion of the filename in a different place.
For others fighting the same problem, ensure that all the new paths are up to date.
Thanks.
Upvotes: 1
Reputation: 100322
Instead of chrome://global/content/browser.xul
it is chrome://browser/content/browser.xul
.
I found a page, here, where it is explains very well how to achieve this.
In another documentation page, I found:
The CSS file with your toolbar styles needs to be included in the overlay file, as you would expect, but also in the chrome.manifest file. This is very important because the toolbar customization dialog won't work correctly without this. The way to include the file in the manifest is to add this line:
style chrome://global/content/customizeToolbar.xul chrome://xulschoolhello/skin/toolbar.css
The documentation is very messy, I was looking at one about Firefox 1.5 when I copied the url. :S
Upvotes: 0