The first step to interacting with bookmarks is to get a reference to the bookmark service/manager. The steps below all base themselves off this code here:
// Get the service pane first, and initialise it var SPS = Components.classes['@songbirdnest.com/servicepane/service;1'] .getService(Components.interfaces.sbIServicePaneService); SPS.init(); // Now get the bookmark service var BMS = Components.classes['@songbirdnest.com/servicepane/bookmarks;1'] .getService(Components.interfaces.sbIBookmarks);
var bookmarkNode = BMS.addFolder("My Bookmarks");
var node = BMS.addBookmarkAt("http://songbirdnest.com", "Songbird Homepage", null,
bookmarkNode, null);
Let's say you wanted to remove the Birdhouse link from the Service Pane, you can accomplish this by doing:
// Try to find the Birdhouse node in the service pane, and remove it
var birdhouse = SPS.getNode("http://birdhouse.songbirdnest.com/");
if (birdhouse)
SPS.removeNode(birdhouse);
| Images 0 | ||
|---|---|---|
| No images to display in the gallery. |