views:

95

answers:

1

I can check if a folder is empty.

this.emptyfolder = function(folderid) {
    result = PlacesUtils.getFolderContents(folderid);
    resultContainerNode = result.root;
    if (resultContainerNode.ChildCount == 0) {
        return true;
    } else {
        return false;
    }
}

How to check if a folder exists even if it's empty?

+1  A: 

many bookmarks service methods will throw if and item id does not exist, so for example PlacesUtils.bookmarks.getItemType(itemId); will throw. But actually, I'm missing your use-case, when working with folders you usually work with views, and you the don't bother about the fact a certain item id exists.