How to Export Chrome Bookmarks as JSON — and Why I Built a One-Click Extension for It
Source: Dev.to
What it does
- No popup, no settings, no account.
- Works offline.
- The whole extension is about 5 KB.
Permissions
bookmarks— to read your bookmark tree
The code
chrome.action.onClicked.addListener(exportBookmarks);
async function exportBookmarks() {
const bookmarks = await chrome.bookmarks.getTree();
const blob = new Blob([JSON.stringify(bookmarks, null, 2)], { type: 'application/json' });
const url = URL.createObjectURL(blob);
chrome.downloads.download({
url,
filename: 'bookmarks.json',
saveAs: true
});
}
The extension uses Manifest V3, the chrome.bookmarks API to retrieve the tree, and chrome.downloads to save the file.
When it’s useful
- Backing up bookmarks in a readable format.
- Version‑controlling your bookmark collection.
- Feeding bookmarks into scripts or other tools that consume JSON.
Try it
- Chrome Web Store – (link to the extension)
- GitHub – (link to the source code)