FUEL:Bookmark
From MDC
This article covers features introduced in Firefox 3
[edit] Method overview
[edit] Attributes
id
| readonly attribute long long
| The id of the bookmark.
|
title
| attribute AString
| The title of the bookmark.
|
uri
| attribute nsIURI
| The uri of the bookmark.
|
description
| attribute AString
| The description of the bookmark.
|
keyword
| attribute AString
| The keyword associated with the bookmark.
|
type
| readonly attribute AString
| The type of the bookmark. values: "bookmark", "separator"
|
parent
| attribute fuelIBookmarkFolder
| The parent folder of the bookmark.
|
annotations
| readonly attribute fuelIAnnotations
| The annotations object for the bookmark.
|
events
| readonly attribute fuelIEvents
| The events object for the bookmark. supports: "remove", "change", "visit", "move"
|
[edit] Methods
[edit] remove()
Removes the item from the parent folder. Used to delete a bookmark or separator
void remove()
[edit] Parameters
[edit] Return value
[edit] Examples
const NEVER_EXPIRE = 0;
function url(spec) {
var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
return ios.newURI(spec, null, null);
}
var bookmark = Application.bookmarks.toolbar.addBookmark("Mozilla", url("http://www.mozilla.com"));
bookmark.keyword = "webdev";
// check some properties
alert(bookmark.title); // should show "Mozilla"
alert(bookmark.uri.spec); // should show "http://www.mozilla.com"
// setup an event to listen for changes to the bookmark
bookmark.events.addListener("change", function(event) { alert(event.data); });
bookmark.title = "MoCo"; // should alert "title"
bookmark.keyword = "addons"; // should alert "keyword"
[edit] See also