Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 778581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:47:13+00:00 2026-05-14T19:47:13+00:00

I’m trying to write a better bookmark manager in Chrome extensions. The problem is

  • 0

I’m trying to write a better bookmark manager in Chrome extensions. The problem is that there are no simple examples (that I can find) about how to actually use the bookmarks API.

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T19:47:13+00:00Added an answer on May 14, 2026 at 7:47 pm

    Currently, there is no good way to find folders such as “Other Bookmarks” or “Bookmarks Bar” in the bookmarks API. You would have to iterate through all the bookmarks and find which node has those root folders and save its bookmark id. The bug is filed Issue 21330.

    The root id is always 0, and when I mean 0, it corresponds to “Bookmarks bar” and “Other bookmarks”. As any tree structure, each node has children. If you want to fetch all the bookmarks under one folder, you can use getChildren API and get every node recursively (you can do it iteratively too). For example, the following will get every single bookmark:

    printBookmarks('0');
    
    function printBookmarks(id) {
     chrome.bookmarks.getChildren(id, function(children) {
        children.forEach(function(bookmark) { 
          console.debug(bookmark.title);
          printBookmarks(bookmark.id);
        });
     });
    }
    

    Now, why do we have to call the API for every iteration? Their is an API to get the whole Tree. If you tried it out, you will see that every node in the getTree will have a list of children. That is perfect:

    chrome.bookmarks.getTree(function(bookmarks) {
      printBookmarks(bookmarks);
    });
    
    function printBookmarks(bookmarks) {
      bookmarks.forEach(function(bookmark) {
        console.debug(bookmark.id + ' - ' + bookmark.title + ' - ' + bookmark.url);
        if (bookmark.children)
          printBookmark(bookmark.children);
      });
    }
    

    That is all, you can do all this iteratively as well which is better performance, but you can figure that out 🙂 Note that since you want to redo the bookmarks bar, you can override that page in extensions (soon):
    http://code.google.com/chrome/extensions/override.html

    If you want to show a nice HTML tree of your bookmarks, you can easily do that by extending the getTree functionality I showed above to accept a parent DOM. You can do something like this. Edit the code to make use of the getTree or collapse everything and make use of the getChildren and fetch more bookmarks if they request it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 386k
  • Answers 386k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer A plus in the URL means a space. You should… May 14, 2026 at 11:48 pm
  • Editorial Team
    Editorial Team added an answer You should have a look at this question, your issue… May 14, 2026 at 11:48 pm
  • Editorial Team
    Editorial Team added an answer The way I do it is, using a backgroundworker. Then… May 14, 2026 at 11:48 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.