nsISidebar

IID:577CB745-8CAF-11d3-AAEF-00805F8A4905
Inherits From:nsISupports

This interface is implemented by the following components:


Methods

void addPanel ( PRUnichar* title , char* contentURL , char* customizeURL ) void addPersistentPanel ( PRUnichar* title , char* contentURL , char* customizeURL ) void addSearchEngine ( char* engineURL , char* iconURL , PRUnichar* suggestedTitle , PRUnichar* suggestedCategory )

void addPanel ( PRUnichar* title , char* contentURL , char* customizeURL )

Arguments:
title
contentURL
customizeURL

void addPersistentPanel ( PRUnichar* title , char* contentURL , char* customizeURL )

Arguments:
title
contentURL
customizeURL

void addSearchEngine ( char* engineURL , char* iconURL , PRUnichar* suggestedTitle , PRUnichar* suggestedCategory )

Arguments:
engineURL
iconURL
suggestedTitle
suggestedCategory

Reference documentation is generated from Mozilla's source.

Add a note User Contributed Notes
March 21, 2005, 12:22 pm hamoth at hotmail dot com
I went the iFrame route at first, but later learned that while there may be some applications that require an iFrame for swapping the content of a sidebar, one should first consider if using a <deck> element would fulfill their needs. Using <deck> lets on have multiple sections in one xul document.

August 7, 2004, 3:34 pm bricca at gmx dot net
if you use the addPanel function in firefox - it just wants to store a bookmark .. with the 'load in sidebar' flag set.
to add a panel to the menu as view->sidebar->mysidebar you'd have to use xul. a broadcaster as ex. in the main xul file with a reference to a chrome uri.
(the sidebarurl tag in the broadcaster is imho (tested it in ff) not changable so you would have to use as ex. a second xul with an iframe to load an uri in the sidebar)

a code sample .. (a ff extension showing this would be slashzilla)

<broadcasterset id="mainBroadcasterSet">
<broadcaster id="cmd_viewSidebar"
autoCheck="false"
type="checkbox" group="sidebar"
sidebarurl="chrome://Sidebar/content/Sidebar.xul"
sidebartitle="&Sidebar.title;"
oncommand="toggleSidebar('cmd_viewSidebar');"/>
</broadcasterset>

<!-- viewSidebarMenu is the descriptor where to place the menuitem -->
<menupopup id="viewSidebarMenu">
<menuitem key="key_viewSidebar" label="&Sidebar.label;"
observes="cmd_viewSidebar"/>
</menupopup>

Copyright © 1999 - 2005 XULPlanet.com