[Project_owners] Opening "Customize Toolbar" window

Bartosz Piec bpiec at student.uci.agh.edu.pl
Fri Sep 1 19:36:11 EDT 2006


Hello,

How to open a "Customize Toolbar" window from my extension's preference 
window? I've tried to execute the code from Firefox's browser.js file:

function BrowserCustomizeToolbar()
{
   // Disable the toolbar context menu items
   var menubar = document.getElementById("main-menubar");
   for (var i = 0; i < menubar.childNodes.length; ++i)
     menubar.childNodes[i].setAttribute("disabled", true);

   var cmd = document.getElementById("cmd_CustomizeToolbars");
   cmd.setAttribute("disabled", "true");

   window.openDialog("chrome://global/content/customizeToolbar.xul", 
"CustomizeToolbar",
                     "chrome,all,dependent", 
document.getElementById("navigator-toolbox"));
}

but the menubar variable is null.

-- 
Regards,
Bartosz Piec


More information about the Project_owners mailing list