--- /dev/null
+#!/bin/sh
+
+set -e
+set -u
+
+export PKG=custom-toolbar-button@example.com
+
+[ ! -e $PKG.xpi ] || rm $PKG.xpi
+
+jar -v -M -c -f $PKG.xpi chrome install* chrome.manifest
--- /dev/null
+content custombutton chrome/
+style chrome://global/content/customizeToolbar.xul chrome://custombutton/content/button.css
+
+# Firefox
+overlay chrome://browser/content/browser.xul chrome://custombutton/content/button.xul
--- /dev/null
+#custom-button-1,
+#wrapper-custom-button-1
+{list-style-image: url("chrome://custombutton/content/button-1.png");}
+
+/* common style for all custom buttons */
+.custombutton
+{-moz-image-region: rect( 0px 24px 24px 0px);}
+
+.custombutton:hover
+{-moz-image-region: rect(24px 24px 48px 0px);}
+
+[iconsize="small"] .custombutton
+{-moz-image-region: rect( 0px 40px 16px 24px);}
+
+[iconsize="small"] .custombutton:hover
+{-moz-image-region: rect(24px 40px 40px 24px);}
+
--- /dev/null
+CustomButton = {
+
+1: function () {
+ alert("Just testing")
+ },
+
+}
+
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-stylesheet type="text/css"
+ href="chrome://custombutton/content/button.css"?>
+
+<!DOCTYPE overlay >
+<overlay id="custombutton-overlay"
+ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+<script type="application/x-javascript"
+ src="chrome://custombutton/content/button.js"/>
+
+<!-- Firefox -->
+<toolbarpalette id="BrowserToolbarPalette">
+ <toolbarbutton id="custom-button-1"/>
+ </toolbarpalette>
+
+
+<!-- button details -->
+<toolbarbutton id="custom-button-1"
+ label="Custom"
+ tooltiptext="My custom toolbar button"
+ oncommand="CustomButton[1]()"
+ class="toolbarbutton-1 chromeclass-toolbar-additional custombutton"
+ />
+
+</overlay>
+
--- /dev/null
+<?xml version="1.0"?>
+
+<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:em="http://www.mozilla.org/2004/em-rdf#">
+
+ <Description
+ about="urn:mozilla:install-manifest"
+
+ em:name="Custom Button"
+ em:description="My custom toolbar button"
+ em:creator="My name"
+
+ em:id="custom-toolbar-button@example.com"
+ em:version="1.0"
+ em:homepageURL="http://developer.mozilla.org/en/docs/Custom_Toolbar_Button"
+
+ em:iconURL="chrome://custombutton/content/icon.png" >
+
+ <em:targetApplication><!-- Firefox -->
+ <Description
+ em:id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"
+ em:minVersion="1.4"
+ em:maxVersion="99" />
+ </em:targetApplication>
+
+ <em:file>
+ <Description
+ about="urn:mozilla:extension:custombutton"
+ em:package="content/custombutton/" />
+ </em:file>
+
+ </Description>
+
+</RDF>
+