The WebExtensions bookmarks API lets an extension interact with and manipulate the browser's bookmarking system. You can use it to bookmark pages, retrieve existing bookmarks, and edit, remove, and organize bookmarks.

To use this API, an extension must request the "bookmarks" permission in its manifest.json file.

TypesSection

bookmarks.BookmarkTreeNode
Represents a bookmark or folder in the bookmarks tree.
bookmarks.BookmarkTreeNodeType
A String enum which describes whether a node in the tree is a bookmark, a folder, or a separator.
bookmarks.BookmarkTreeNodeUnmodifiable
A String enum which specifies why a bookmark or folder is unmodifiable.
bookmarks.CreateDetails
Contains information which is passed to the bookmarks.create() function when creating a new bookmark.

FunctionsSection

bookmarks.create()
Creates a bookmark or folder.
bookmarks.get()
Retrieves one or more BookmarkTreeNodes, given a bookmark's ID or an array of bookmark IDs.
bookmarks.getChildren()
Retrieves the children of the specified BookmarkTreeNode.
bookmarks.getRecent()
Retrieves a requested number of recently added bookmarks.
bookmarks.getSubTree()
Retrieves part of the bookmarks tree, starting at the specified node.
bookmarks.getTree()
Retrieves the entire bookmarks tree into an array of BookmarkTreeNode objects.
bookmarks.move()
Moves the specified BookmarkTreeNode to a new location in the bookmark tree.
bookmarks.remove()
Removes a bookmark or an empty bookmark folder, given the node's ID.
bookmarks.removeTree()
Recursively removes a bookmark folder; that is, given the ID of a folder node, removes that node and all its descendants.
bookmarks.search()
Searches for BookmarkTreeNodes matching a specified set of criteria.
bookmarks.update()
Updates the title and/or URL of a bookmark, or the name of a bookmark folder, given the bookmark's ID.

EventsSection

bookmarks.onCreated
Fired when a bookmark or folder is created.
bookmarks.onRemoved
Fired when a bookmark or folder is removed. When a folder is removed recursively, a single notification is fired for the folder, and none for its contents.
bookmarks.onChanged
Fired when a bookmark or folder changes. Currently, only title and url changes trigger this.
bookmarks.onMoved
Fired when a bookmark or folder is moved to a different parent folder or to a new offset within its folder.
bookmarks.onChildrenReordered
Fired when the user has sorted the children of a folder in the browser's UI. This is not called as a result of a move().
bookmarks.onImportBegan
Fired when a bookmark import session is begun. Expensive observers should ignore bookmarks.onCreated updates until bookmarks.onImportEnded is fired. Observers should still handle other notifications immediately.
bookmarks.onImportEnded
Fired when a bookmark import session has finished.

Browser compatibilitySection

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxOperaFirefox for Android
BookmarkTreeNodeChrome Full support YesEdge No support NoFirefox Full support 45Opera Full support YesFirefox Android No support No
BookmarkTreeNodeTypeChrome No support NoEdge No support NoFirefox Full support 57Opera No support NoFirefox Android No support No
BookmarkTreeNodeUnmodifiableChrome Full support YesEdge No support NoFirefox Full support 45Opera Full support YesFirefox Android No support No
CreateDetailsChrome Full support YesEdge No support NoFirefox Full support 45Opera Full support YesFirefox Android No support No
createChrome Full support YesEdge Full support 15Firefox Full support 45Opera Full support YesFirefox Android No support No
getChrome Full support YesEdge No support NoFirefox Full support 45Opera Full support YesFirefox Android No support No
getChildrenChrome Full support YesEdge No support NoFirefox Full support 45Opera Full support YesFirefox Android No support No
getRecentChrome Full support YesEdge No support NoFirefox Full support 47Opera Full support YesFirefox Android No support No
getSubTreeChrome Full support YesEdge No support NoFirefox Full support 45Opera Full support YesFirefox Android No support No
getTreeChrome Full support YesEdge Full support 15Firefox Full support 45Opera Full support YesFirefox Android No support No
moveChrome Full support YesEdge Full support 15Firefox Full support 45Opera Full support YesFirefox Android No support No
onChangedChrome Full support YesEdge No support NoFirefox Full support 52Opera Full support YesFirefox Android No support No
onChildrenReorderedChrome Full support YesEdge No support NoFirefox No support NoOpera Full support YesFirefox Android No support No
onCreatedChrome Full support YesEdge No support NoFirefox Full support 52Opera Full support YesFirefox Android No support No
onImportBeganChrome Full support YesEdge No support NoFirefox No support NoOpera Full support YesFirefox Android No support No
onImportEndedChrome Full support YesEdge No support NoFirefox No support NoOpera Full support YesFirefox Android No support No
onMovedChrome Full support YesEdge No support NoFirefox Full support 52Opera Full support YesFirefox Android No support No
onRemovedChrome Full support YesEdge No support NoFirefox Full support 52Opera Full support YesFirefox Android No support No
removeChrome Full support YesEdge Full support 15Firefox Full support 45Opera Full support YesFirefox Android No support No
removeTreeChrome Full support YesEdge Full support 15Firefox Full support 47Opera Full support YesFirefox Android No support No
searchChrome Full support YesEdge No support NoFirefox Full support 47Opera Full support YesFirefox Android No support No
updateChrome Full support YesEdge Full support 15Firefox Full support 45Opera Full support YesFirefox Android No support No

Legend

Full support  
Full support
No support  
No support

Example extensionsSection

Acknowledgements

This API is based on Chromium's chrome.bookmarks API. This documentation is derived from bookmarks.json in the Chromium code.

Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.

Document Tags and Contributors

Contributors to this page: fscholz, wbamberg, andrewtruongmoz, abbycar, Sheppy, evilpie
Last updated by: fscholz,