SeleniumHQ/selenium · error · AddonFormatError

Could not find add-on ID for ${extension}

Error message

Could not find add-on ID for ${extension}

What it means

Thrown by installExtension() in firefox.js when the parsed manifest.json lacks a Firefox add-on ID. The code checks browser_specific_settings.gecko.id then falls back to applications.gecko.id; if neither yields an ID, this error fires. Firefox requires a stable add-on ID to install extensions into a profile.

Source

Thrown at javascript/selenium-webdriver/firefox.js:177

  let parsedJSON = JSON.parse(buf.toString('utf8'))

  let { browser_specific_settings } =
    /** @type {{browser_specific_settings:{gecko:{id:string}}}} */
    parsedJSON

  if (browser_specific_settings && browser_specific_settings.gecko) {
    /* browser_specific_settings is an alternative to applications
     * It is meant to facilitate cross-browser plugins since Firefox48
     * see https://bugzilla.mozilla.org/show_bug.cgi?id=1262005
     */
    parsedJSON.applications = browser_specific_settings
  }

  let { applications } =
    /** @type {{applications:{gecko:{id:string}}}} */
    parsedJSON
  if (!(applications && applications.gecko && applications.gecko.id)) {
    throw new AddonFormatError(`Could not find add-on ID for ${extension}`)
  }

  await io.copy(extension, `${path.join(dir, applications.gecko.id)}.xpi`)
  return applications.gecko.id
}

class Profile {
  constructor() {
    /** @private {?string} */
    this.template_ = null

    /** @private {!Array<string>} */
    this.extensions_ = []
  }

  addExtensions(/** !Array<string> */ paths) {
    this.extensions_ = this.extensions_.concat(...paths)
  }

View on GitHub (pinned to aa36b38e69)

Solutions

  1. Add browser_specific_settings: { gecko: { id: 'your-addon@your-domain.com' } } to manifest.json.
  2. Alternatively set applications.gecko.id (legacy key, still read by the code).
  3. Ensure the ID follows the Firefox format (email-like or UUID format).

Example fix

// before — manifest.json has no gecko id
{
  "manifest_version": 2,
  "name": "My Ext",
  "version": "1.0"
}
// after
{
  "manifest_version": 2,
  "name": "My Ext",
  "version": "1.0",
  "browser_specific_settings": {
    "gecko": { "id": "my-ext@example.com" }
  }
}
Defensive patterns

Strategy: validation

Validate before calling

function validateManifestHasGeckoId(manifest) {
  const id =
    manifest?.browser_specific_settings?.gecko?.id ??
    manifest?.applications?.gecko?.id
  if (!id) {
    throw new Error('manifest.json must define browser_specific_settings.gecko.id or applications.gecko.id')
  }
  return id
}

Prevention

When it happens

Trigger: The extension manifest has no applications or browser_specific_settings block. The gecko.id field is missing or empty. Using a manifest V3 extension without gecko-specific settings.

Common situations: Developing/testing an unsigned local extension without declaring an ID; porting a Chrome extension (which has no gecko ID requirement); manifest generated by a tool that omits the gecko block.

Related errors


AI-assisted analysis of SeleniumHQ/selenium@aa36b38e69 (2026-08-14). Data as JSON: /api/errors/6b7c7a7ce200508a. Report an issue: GitHub.