SeleniumHQ/selenium · error · AddonFormatError

Add-on id could not be found.

Error message

Add-on id could not be found.

What it means

Raised as AddonFormatError after successful install.rdf parsing if no add-on id could be determined — neither from a child node named 'id' nor from an 'em:id' attribute on the Description element. Firefox requires every add-on to have an id, so the parser treats a missing id as an invalid addon.

Source

Thrown at py/selenium/webdriver/firefox/firefox_profile.py:326

                # Remove the namespace prefix from the tag for comparison
                entry = node.nodeName.replace(em, "")
                if entry in details:
                    details.update({entry: get_text(node)})
            if not details.get("id"):
                for i in range(description.attributes.length):
                    attribute = description.attributes.item(i)
                    if attribute.name == em + "id":
                        details.update({"id": attribute.value})
        except Exception as e:
            raise AddonFormatError(str(e), sys.exc_info()[2])

        # turn unpack into a true/false value
        if isinstance(details["unpack"], str):
            details["unpack"] = details["unpack"].lower() == "true"

        # If no ID is set, the add-on is invalid
        if not details.get("id"):
            raise AddonFormatError("Add-on id could not be found.")

        return details

View on GitHub (pinned to aa36b38e69)

Solutions

  1. Open the install.rdf and add an <em:id> element inside the Description: <em:id>myaddon@example.com</em:id>
  2. Verify the namespace URI is correct (http://www.mozilla.org/2004/em-rdf#) so the parser can locate the id field
  3. Use a WebExtension with manifest.json instead, which requires the id in applications.gecko.id

Example fix

// before
<!-- install.rdf with no em:id -->
<RDF:Description>
  <em:name>MyAddon</em:name>
</RDF:Description>

// after
<RDF:Description>
  <em:id>myaddon@example.com</em:id>
  <em:name>MyAddon</em:name>
</RDF:Description>
Defensive patterns

Strategy: validation

Validate before calling

import xml.dom.minidom as minidom
doc = minidom.parseString(open('install.rdf').read())
desc = doc.getElementsByTagName('Description').item(0)
has_id = any(a.name.endswith('id') for i in range(desc.attributes.length) for a in [desc.attributes.item(i)])
if not has_id:
    print('Warning: install.rdf has no em:id field')

Try / catch

from selenium.common.exceptions import AddonFormatError
try:
    profile.add_extension(addon_path)
except AddonFormatError as e:
    if 'id could not be found' in str(e):
        print('Add em:id to install.rdf or use manifest.json format')

Prevention

When it happens

Trigger: An install.rdf whose Description element lacks both an <em:id> child node and an em:id attribute. This happens with RDF files that omit the required identifier fields.

Common situations: Hand-authored install.rdf files missing the em:id field. Addons generated by broken build tools. RDF files from very old or experimental extensions that don't declare an id.

Related errors


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