Skip to content

Latest commit

 

History

History
61 lines (42 loc) · 3.02 KB

README.md

File metadata and controls

61 lines (42 loc) · 3.02 KB

WebExtension Experiment For Firefox Tags

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.

How to install this API and the associated WebExtension

  1. Run a non-release build (Nightly or unbranded Beta/Release), the latest tested working version is 103.0b2 (or newer) build.
  2. Navigate to about:config
    • set the pref extensions.legacy.enabled to true
    • set the pref extensions.experiments.enabled to true
  3. Navigate to about:debugging, choose "Load Temporary Add-on" and select manifest.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.

API

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

References

Disclaimer

This software is supplied "AS IS" without any warranties and support.

Author

Andrew Zappella