How to use the mdn-browser-compat-data.webextensions function in mdn-browser-compat-data

To help you get started, we’ve selected a few mdn-browser-compat-data examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github connorshea / mdn-compat-data-explorer / lib / build.js View on Github external
//   svg: compatData.svg,
//   webdriver: compatData.webdriver,
//   webextensions: compatData.webextensions
// }

const payload = {
  api: compatData.api,
  browsers: compatData.browsers,
  css: compatData.css,
  html: compatData.html,
  http: compatData.http,
  javascript: compatData.javascript,
  mathml: compatData.mathml,
  svg: compatData.svg,
  webdriver: compatData.webdriver,
  webextensions: compatData.webextensions
}

fs.writeFile(
  path.resolve(
    __dirname,
    '..',
    'public',
    'data.json'
  ),
  JSON.stringify(payload, null, 2),
  err => {
    if (err) {
      console.error(err)
    }
  }
)
github mozilla / addons-linter / src / parsers / manifestjson.js View on Github external
) {
      if (this.isDictionary) {
        // Dictionaries should not have a strict_max_version at all.
        this.isValid = false;
        this.collector.addError(messages.STRICT_MAX_VERSION);
      } else {
        // Rest of the extensions can, even though it's not recommended.
        this.collector.addNotice(messages.STRICT_MAX_VERSION);
      }
    }

    const minVersion = firefoxStrictMinVersion(this.parsedJSON);
    if (!this.isLanguagePack && !this.isDictionary && minVersion) {
      for (const key in bcd.webextensions.manifest) {
        if (Object.prototype.hasOwnProperty.call(this.parsedJSON, key)) {
          const compatInfo = bcd.webextensions.manifest[key];
          this.checkCompatInfo(
            compatInfo,
            minVersion,
            key,
            this.parsedJSON[key]
          );
        }
      }
    }

    if (isToolkitVersionString(this.parsedJSON.version)) {
      this.collector.addNotice(messages.PROP_VERSION_TOOLKIT_ONLY);
    }

    if (this.parsedJSON.default_locale) {
      const msg = path.join(
github mozilla / addons-linter / src / parsers / manifestjson.js View on Github external
this.parsedJSON.applications.gecko &&
      this.parsedJSON.applications.gecko.strict_max_version
    ) {
      if (this.isDictionary) {
        // Dictionaries should not have a strict_max_version at all.
        this.isValid = false;
        this.collector.addError(messages.STRICT_MAX_VERSION);
      } else {
        // Rest of the extensions can, even though it's not recommended.
        this.collector.addNotice(messages.STRICT_MAX_VERSION);
      }
    }

    const minVersion = firefoxStrictMinVersion(this.parsedJSON);
    if (!this.isLanguagePack && !this.isDictionary && minVersion) {
      for (const key in bcd.webextensions.manifest) {
        if (Object.prototype.hasOwnProperty.call(this.parsedJSON, key)) {
          const compatInfo = bcd.webextensions.manifest[key];
          this.checkCompatInfo(
            compatInfo,
            minVersion,
            key,
            this.parsedJSON[key]
          );
        }
      }
    }

    if (isToolkitVersionString(this.parsedJSON.version)) {
      this.collector.addNotice(messages.PROP_VERSION_TOOLKIT_ONLY);
    }