function RemovePersonalToolbar() { var personalToolbarFolder = document.getElementById("NC:PersonalToolbarFolder"); dump("personalToolbarFolder = " + personalToolbarFolder + "\n"); if (personalToolbarFolder == null) return; var bookmarksRoot = document.getElementById("NC:BookmarksRoot"); dump("bookmarksRoot = " + bookmarksRoot + "\n"); if (bookmarksRoot == null) return; bookmarksRoot.removeChild(personalToolbarFolder); } function AddPersonalToolbar() { var bookmarksRoot = document.getElementById("NC:BookmarksRoot"); dump("bookmarksRoot = " + bookmarksRoot + "\n"); if (bookmarksRoot == null) return; var personalToolbarFolder = document.getElementById("NC:PersonalToolbarFolder"); dump("personalToolbarFolder = " + personalToolbarFolder + "\n"); if (personalToolbarFolder != null) // already there return; personalToolbarFolder = document.createElement("xul:treeitem"); personalToolbarFolder.setAttribute("id", "NC:PersonalToolbarFolder"); bookmarksRoot.appendChild(personalToolbarFolder); } function MutateBody() { // This test changes the "id" attribute on the treebody var tree = document.getElementById("tree"); dump("tree = " + tree + "\n"); var body = tree.childNodes[3]; // two treecols, a treehead, and a treebody dump("body = " + body + "\n"); var currentId = body.getAttribute("id"); dump("currentId = " + currentId + "\n"); if (currentId == "NC:BookmarksRoot") { body.setAttribute("id", "NC:PersonalToolbarFolder"); } else { body.setAttribute("id", "NC:BookmarksRoot"); } } Remove Personal Toolbar Add Personal Toolbar MutateBody Name URL