Published Tabzero Team· Updated

Chrome Bookmarks API vs Saved Sessions: Build a Safe Import

A bookmark is a durable destination; a saved session is the context for a task. An extension can connect the two, but importing an entire bookmark tree without review often turns old reference folders into noisy project notes.

Chrome Bookmarks API vs Saved Sessions: Build a Safe Import

Understand the bookmark tree

Chrome represents bookmarks and folders as BookmarkTreeNode objects. A folder is a node without a page URL; a bookmark node has a URL and a title. chrome.bookmarks.getTree() can read the hierarchy, while chrome.bookmarks.search() can find candidates by text. Keep the parent folder path when showing a result so two identical page titles remain distinguishable.

The bookmarks API requires the bookmarks manifest permission. Its warning reflects the ability to read and change bookmarks, so ask for it only when a real import or bookmark-management feature needs it. A session manager that merely opens saved links does not automatically need bookmark access.

Choose what should become a project source

Start from one user-selected folder rather than every bookmark. Show its page count, titles, URLs and subfolders. Let the user choose pages relevant to the current task. A reference that remains useful by itself can stay a bookmark; a project source needs a note explaining why it belongs with the other pages.

Do not infer that every page in a folder is still valid. Old bookmarks may redirect, require an account or point to a versioned document. Preserve the original URL in the preview and let the person confirm the destination before saving.

Make import repeatable without duplicates

A basic import record can store the bookmark node ID as an import hint, the reviewed URL, the destination note ID and the import time. Before adding a source, compare it with sources already in that note. Offer a choice when the same URL appears under a different title instead of silently creating another copy.

Bookmark IDs and browser state are not a long-term project identity. If the bookmark is later moved or deleted, the saved session should still contain its own source record and written context. Keep a manual undo path for a mistaken import.

Chrome Bookmarks API vs Saved Sessions: Build a Safe Import contextual product example
An example browser-tab view for finding, selecting and returning to the pages that belong to a task. Credit: Tabzero.

Avoid changing the user's bookmarks by accident

chrome.bookmarks.create(), move() and remove() change the browser's bookmark tree. An import into a separate session note usually needs reading, not mutation. Keep 'Import to note' distinct from 'Move bookmarks' or 'Delete duplicates' in the UI.

If a feature truly edits bookmarks, show the exact folder and affected count before applying it. Test with a disposable profile first; a successful API call can still be a surprising change to a person's established browser organization.

Idea: a bookmark-to-project review screen

Build a two-column screen: selected bookmark folder on the left and the target project note on the right. Let users check relevant pages, add a one-sentence reason for each group and preview duplicates before committing. Keep the original bookmarks untouched by default.

After import, open two representative links and confirm the note explains their relationship. This transforms a folder of destinations into a task that can be resumed rather than merely copying links to another list.

Test the edge cases

Try nested folders, duplicate URLs, blank titles, redirects and a bookmark deleted between preview and import. Handle a revoked bookmarks permission without damaging the target note. Verify that import can be retried after a partial failure without doubling the successfully saved sources.

A useful success message reports the number of selected, imported, skipped and failed links. It does not claim the bookmarked websites themselves were archived.

Tabzero: Browser Tab Manager & Notes

Save tab links, keep notes beside your sources, and return to what matters. Tabzero is in development preview; AI Notes remains planned.

Check availability