zakius / webextension-experiment-tags

WebExtension Experiment API to get access/read bookmark tags in Firefox

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WebExtension Experiment For Firefox Tags

Since the WebExtensions API does not currently support bookmarks tags, I created this WebExtension Experiment API to expose some of the internal Firefox API for tags, thus enabling users/developers to access/read/retrieve bookmark tags in their own extensions.

NOTE: It is very likely that this API will not work in the near future, as there are plans to merge the tagging API with the bookmarking API.

How to install this API and WebExtension

  1. Run a non-release build (Nightly or unbranded Beta/Release) version 59 (or newer) build.
  2. Navigate to about:config and set the pref extensions.legacy.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

getURIsForTag(tag) - Finding all URLs with a given tag

const uris = browser.experiments.tags.getURIsForTag("tag 1");

// 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

About

WebExtension Experiment API to get access/read bookmark tags in Firefox


Languages

Language:JavaScript 100.0%