1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-03 20:04:11 +01:00

Another attempt at revision 8613b76cff40.

This commit is contained in:
Kris Maglione
2011-02-03 09:48:10 -05:00
parent e470de350c
commit d48dcd8723
16 changed files with 149 additions and 111 deletions

View File

@@ -117,6 +117,28 @@ var BookmarkCache = Module("BookmarkCache", XPCOM(Ci.nsINavBookmarkObserver), {
isBookmark: function (id) this.rootFolders.indexOf(this.findRoot(id)) >= 0,
/**
* Returns true if the given URL is bookmarked and that bookmark is
* not a Live Bookmark.
*
* @param {nsIURI|string} url The URL of which to check the bookmarked
* state.
* @returns {boolean}
*/
isBookmarked: function isBookmarked(uri) {
if (isString(uri))
uri = util.newURI(uri);
try {
return services.bookmarks
.getBookmarkIdsForURI(uri, {})
.some(this.closure.isRegularBookmark);
}
catch (e) {
return false;
}
},
isRegularBookmark: function isRegularBookmark(id) {
do {
var root = id;