Get Google Chrome's root bookmarks folder

后端 未结 3 1712
遥遥无期
遥遥无期 2021-01-31 06:53

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 A

3条回答
  •  逝去的感伤
    2021-01-31 07:26

    Okay, I've discovered how to get access to what I want. In retrospect I should have seen it sooner.

    http://code.google.com/chrome/extensions/tut_debugging.html

    Using the debugger I was able to set a breakpoint and view the objects. [object Object] is an array of length 1.

    Using the function given in my example, tree[0].children is the array containing the children. On my default setup tree has two children, tree[0].children[0] is "Bookmarks Bar" and tree[0].children[1] is "Other Bookmarks". The rest of the bookmark tree flows down from there, though "Other Bookmarks" (tree[0].children[1]) is the folder I'm looking for.

提交回复
热议问题