Since the WebExtension API does not currently support bookmarks tags (see bugzilla thread, I created this WebExtension Experiment API to expose some of the internal Firefox API for tags, thus enabling users/developers to access & retrieve bookmark tags in their own extensions.
There is an example extension (in the /src folder) which shows how to use the experimental API in a background.js script.
- Run a non-release build (Nightly or unbranded Beta/Release), the latest tested working version is 103.0b2 (or newer) build.
- Navigate to
about:config
- set the pref
extensions.legacy.enabled
totrue
- set the pref
extensions.experiments.enabled
totrue
- set the pref
- Navigate to
about:debugging
, choose "Load Temporary Add-on" and selectmanifest.json
in this project. You should see a new entry in the list of extensions titled "Firefox Bookmark Webhooks".
You should see a new toolbar icon that resembles a tag.
getURIsForTags(tags)
- Finding all URLs with a given tag
const uris = browser.experiments.tags.getURIsForTags(["tag 1","tag 2"]);
// Returns an array of URIs
getTagsForURI(URI)
- Getting all tags associated with a URL
const tags = browser.experiments.tags.getTagsForURI("http://example.com/");
// Returns an array of tags stored for that URI
- Firefox issue tracker #1225916
- StackOverflow Question About Getting Bookmark Tags
- WebExtensions API currently not supporting bookmarks tags
- WebExtensions API Development
- PlacesUtils.bookmarks.fetch implementation
- Firefox Places Architecture Overview
- PlacesUtils.jsm module source code
Using The Places Tagging ServicensITaggingServiceXPConnectWrappersXPConnectWrappers More Information
This software is supplied "AS IS" without any warranties and support.
Andrew Zappella