Created
April 7, 2010 15:16
-
-
Save pwlin/358999 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create XUL element | |
function createToolbarButton() { | |
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; | |
var anitem = document.createElementNS(XUL_NS, "toolbarbutton"); | |
anitem.setAttribute("id", "Testing-Doit-Button2"); | |
anitem.setAttribute("class", "toolbarbutton-1 chromeclass-toolbar-additional"); | |
anitem.setAttribute("label", "label"); | |
anitem.setAttribute("tooltiptext", "Do it!"); | |
anitem.setAttribute("oncommand", "testing_doit();"); | |
return anitem; | |
} | |
function placeToolbarButton() { | |
var bar = document.getElementById("nav-bar"); | |
var newitem = createToolbarButton(); | |
bar.appendChild(newitem); | |
} | |
placeToolbarButton(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment