[Project_owners] Opening "Customize Toolbar" window

Michael Buckley michael.buckley at hotmail.com
Sat Sep 2 09:59:56 EDT 2006

Brian King wrote:
>Bartosz Piec wrote:
>>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", 
>>                     "chrome,all,dependent", 
>>but the menubar variable is null.
>Sounds like the wrong scope, i.e. Try using the window manager to get the 
>browser window (lets call it win), then replace all occurrences of 
>document.getElementById with win.document.getElementById.
>However, the Customize dialog may not function properly if not opened by 
>the main browser window.
I think you should try to run the BrowserCustomizeToolbar() that belongs
to the main window.  This code should work though I have not tested it.

function CustomizeToolbar() {
  var win =



Nothing but cars & over 100,000 of them at carsales.com.au 

More information about the Project_owners mailing list