w3c / webextensions

Charter and administrivia for the WebExtensions Community Group (WECG)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Proposal: Remove multiple bookmarks in bookmarks.remove()

erosman opened this issue · comments

Background

The bookmarks.remove() API allows the removal of a single bookmark.

Extensions dealing with bookmarks would benefit from having the option to remove multiple bookmarks with a single requests, instead of removing them one by one.

Proposal

Update the API to accept string, or array of strings, similar to StorageArea.remove().

let removingBookmark = browser.bookmarks.remove(
  ids              // string, or array of strings
)

To add some context. Seems one of the motivations for this proposal is performance. Removing a big amount of bookmarks can take some time.

In this thread, (erosman/support#595) @bilgincoskun mentions:

The main caveats with the current API are:

  • It is true that with many bookmarks, it takes long time to remove all links, although with async calls, the browser continues to work fine. I didn't try with 5000+ tabs but from what I see with about 500 bookmarks the main the bottleneck is bookmark numbers, whether the bookmarks are in the same folder, if they have only one copy etc. and not tab number.
  • Same cannot be said for bookmark operations. Adding new bookmarks lags for several seconds.
  • Although not due to the extension but the API itself, another caveat is about tags. When removed and added back, same tags are still present until removed from the dialog.