Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

bookmarks.remove()

我们的志愿者还没有将这篇文章翻译为 中文 (简体)加入我们帮助完成翻译!

The bookmarks.remove() method removes a single bookmark or an empty bookmark folder.

If the bookmark item could not be found or was a non-empty folder, runtime.lastError is set, and you can check for it in the callback.

Syntax

chrome.bookmarks.remove(
  id,                 // string
  function() {...}    // optional function
)

This API is also available as browser.bookmarks.remove() in a version that returns a promise.

Parameters

id
A string specifying the ID of the bookmark or empty folder to remove.
callback Optional
A function to be called once the specified bookmark or folder has been removed. It is not passed any parameters.

Browser compatibility

Chrome Edge Firefox Firefox for Android Opera
Basic support Yes No 45.0 No 33

Examples

This example removes a

function onRemoved() {
  if (chrome.runtime.lastError) {
    console.log(chrome.runtime.lastError);
  } else {
    console.log("bookmark item removed!");
  }

}

chrome.bookmarks.remove(bookmarkItemId");

Example add-ons

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.

文档标签和贡献者

 此页面的贡献者: Makyen, wbamberg, Sheppy
 最后编辑者: Makyen,