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.
Extensions cannot create, modify, or delete bookmarks in the root node of the bookmarks tree. Doing so causes an error with the message: "The bookmark root cannot be modified"
bookmarks.BookmarkTreeNode
bookmarks.BookmarkTreeNodeType
String
enum which describes whether a node in the tree is a bookmark, a folder, or a separator.bookmarks.BookmarkTreeNodeUnmodifiable
String
enum which specifies why a bookmark or folder is unmodifiable.bookmarks.CreateDetails
bookmarks.create()
function when creating a new bookmark.bookmarks.create()
bookmarks.get()
BookmarkTreeNode
s, given a bookmark's ID or an array of bookmark IDs.bookmarks.getChildren()
BookmarkTreeNode
.bookmarks.getRecent()
bookmarks.getSubTree()
bookmarks.getTree()
BookmarkTreeNode
objects.bookmarks.move()
BookmarkTreeNode
to a new location in the bookmark tree.bookmarks.remove()
bookmarks.removeTree()
bookmarks.search()
BookmarkTreeNode
s matching a specified set of criteria.bookmarks.update()
bookmarks.onCreated
bookmarks.onRemoved
bookmarks.onChanged
title
and url
changes trigger this.bookmarks.onMoved
bookmarks.onChildrenReordered
move()
.bookmarks.onImportBegan
bookmarks.onCreated
updates until bookmarks.onImportEnded
is fired. Observers should still handle other notifications immediately.bookmarks.onImportEnded
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
BookmarkTreeNode |
Yes |
79 |
45 |
? |
Yes |
No |
? |
? |
No |
? |
? |
? |
BookmarkTreeNodeType |
No |
No |
57 |
? |
No |
No |
? |
? |
No |
? |
? |
? |
BookmarkTreeNodeUnmodifiable |
Yes |
79 |
45 |
? |
Yes |
No |
? |
? |
No |
? |
? |
? |
CreateDetails |
Yes |
79 |
45 |
? |
Yes |
No |
? |
? |
No |
? |
? |
? |
create |
Yes |
15 |
45 |
? |
Yes |
No |
? |
? |
No |
? |
? |
? |
get |
Yes |
79 |
45 |
? |
Yes |
No |
? |
? |
No |
? |
? |
? |
getChildren |
Yes |
79 |
45 |
? |
Yes |
No |
? |
? |
No |
? |
? |
? |
getRecent |
Yes |
79 |
47 |
? |
Yes |
No |
? |
? |
No |
? |
? |
? |
getSubTree |
Yes |
79 |
45 |
? |
Yes |
No |
? |
? |
No |
? |
? |
? |
getTree |
Yes |
15 |
45 |
? |
Yes |
No |
? |
? |
No |
? |
? |
? |
move |
Yes |
15 |
45 |
? |
Yes |
No |
? |
? |
No |
? |
? |
? |
onChanged |
Yes |
79 |
52 |
? |
Yes |
No |
? |
? |
No |
? |
? |
? |
onChildrenReordered |
Yes |
79 |
No |
? |
Yes |
No |
? |
? |
No |
? |
? |
? |
onCreated |
Yes |
79 |
52 |
? |
Yes |
No |
? |
? |
No |
? |
? |
? |
onImportBegan |
Yes |
79 |
No |
? |
Yes |
No |
? |
? |
No |
? |
? |
? |
onImportEnded |
Yes |
79 |
No |
? |
Yes |
No |
? |
? |
No |
? |
? |
? |
onMoved |
Yes |
79 |
52 |
? |
Yes |
No |
? |
? |
No |
? |
? |
? |
onRemoved |
Yes |
79 |
52 |
? |
Yes |
No |
? |
? |
No |
? |
? |
? |
remove |
Yes |
15 |
45 |
? |
Yes |
No |
? |
? |
No |
? |
? |
? |
removeTree |
Yes |
15 |
47 |
? |
Yes |
No |
? |
? |
No |
? |
? |
? |
search |
Yes |
79 |
47 |
? |
Yes |
No |
? |
? |
No |
? |
? |
? |
update |
Yes |
15 |
45 |
? |
Yes |
No |
? |
? |
No |
? |
? |
? |
Note: 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.
© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/bookmarks