Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

webext-schema

Package Overview
Dependencies
Maintainers
1
Versions
190
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webext-schema

WebExtensions schemas fetched from hg.mozilla.org

  • 0.8.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
20
decreased by-93.44%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status dependencies Status devDependencies Status npm version

webext-schema

WebExtensions schemas and MailExtensions schemas fetched from hg.mozilla.org

Install

npm i webext-schema

Usage

const {Schema} = require("webext-schema");

const schema = new Schema();

schema.channel

Channel defaults to "beta". "central", "beta", "release" for WebExtensions, and "mail" for MailExtensions are available.

const schema = new Schema("central");

Also, you can set it afterwards.

const schema = new Schema();
schema.channel = "central";

schema.arrange(opt)

  • @param {Object} opt - options
  • @param {string} opt.name - application name
  • @returns {*} - arranged schema

Get the arranged schema for the specific application.

Supported applications:

const schema = new Schema().arrange({name: "sinon-chrome"});
// [{namespace: "alarms", functions: [{...}], ...}];

schema.get(name)

  • @param {string} name - API name or file name
  • @returns {?Array} - schema

Get the schema for the specific API. Argument can be either an API name or a file name.

const schema = new Schema().get("browserAction");
// [{namespace: "browserAction", events: [...], ...}]
const schema = new Schema().get("browser_action.json");
// [{namespace: "browserAction", events: [...], ...}]

schema.getAll()

  • @returns {Object} - all schemas

Get all schemas as a single object. Note that the key of the object is the file name and the value is the schema.

const schema = new Schema().getAll();
// {"alarms.json": [{...}], "bookmarks.json": [{...}], ...}

schema.list()

  • @returns {Array} - file names

Get the list of schema files.

const list = new Schema().list();
// ["alarms.json", "bookmarks.json", ...]

FAQs

Package last updated on 30 Dec 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc