How do I get Google Chrome's root bookmarks folder?
Posted
by Wayne
on Stack Overflow
See other posts from Stack Overflow
or by Wayne
Published on 2010-05-11T16:42:51Z
Indexed on
2010/05/11
22:34 UTC
Read the original article
Hit count: 292
Hi, I'm trying to write a better bookmark manager in chrome extensions. The problem is there are no simple examples (that I can find) about how to actually use the bookmarks api (available here: http://code.google.com/chrome/extensions/bookmarks.html )
I've looked at the example source (when I d/led and installed it on my computer it didn't do anything except provide a search box. Typing/typing and pressing return failed to do anything) and can't find anything useful.
My ultimate goal is to make an extension that allows me to save pages to come and read later without having to go sign up for an account on some service somewhere. So I plan to create either one or two bookmark folders in the root folder/other bookmarks - at minimum an "unread pages" folder. In that folder I'll create the unread bookmarks. When the user marks the item as read, it will be removed from that folder.
So that's what I'm trying to do... any help will be greatly appreciated, even if it's just pointing me to some good examples.
UPDATE:
...<script>
function display(tree){
document.getElementById("Output").innerHTML = tree;
}
function start(){
chrome.bookmarks.getTree(display);
}
</script>
</head>
<body>
<h4 id="Output"></h4>
<script>
start();
</script>
...
That displays [object Object], that suggests (at least to me with a limited JavaScript experience) that an object exists. But how to access the members of that object?
changing tree to tree.id or any other of what look to be parameters displays "undefined".
© Stack Overflow or respective owner