MDN’s new design is in Beta! A sneak peek:

Apparently, unload event is not called while switching sidebars within firefox --Souqueta 06:47, 17 June 2008 (PDT)

toggleSidebar method

I spent quite a while trying to figure out how to use toggleSidebar to close the sidebar. The main problem was that this page doesn't explain what context to call toggleSidebar from. Eventually, I got it working (assuming the sidebar is open) as:

 var mainWindow = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor) 
 .rootTreeItem .QueryInterface(Components.interfaces.nsIInterfaceRequestor) 
 .getInterface(Components.interfaces.nsIDOMWindow); mainWindow.toggleSidebar("viewProveItSidebar");

I found this through a long guess and check.   Hopefully someone more qualified can help clarify the page. mattflaschen 08 September 2008


Right side sidebar for only a specific sidebar

The code given in the example will actually switch all sidebars to the right, not just the one for your extension.  I figured out this method which shifts only the sidebar you want over the right.  There is a minor bug where if you switch to a sidebar that is on the left before closing this sidebar, the separator stays to the right.  Closing your sidebar before opening the second sidebar it works fine.

#sidebar-box[sidebarcommand="viewEmptySidebar"] ~ #sidebar-splitter


--patrickjdempsey 24 Feb 2012

Document Tags and Contributors

 Contributors to this page: patrickjdempsey, mattflaschen, Souqueta
 Last updated by: patrickjdempsey,