function onFulfilled(bookmarkItem) {
console.log(bookmarkItem.title);
}
function onRejected(error) {
console.error(`Error: ${error}`);
}
function updateFolders(items) {
for (const item of items) {
// only folders, so skip items with a `url`
if (!item.url) {
browser.bookmarks
.update(item.id, {
title: "Mozilla Developer Network (MDN)",
})
.then(onFulfilled, onRejected);
}
}
}
browser.bookmarks.search({ title: "MDN" }).then(updateFolders, onRejected);bookmarks.update() / notebook
bookmarks.update()
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.