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
- Open the install.rdf and add an <em:id> element inside the Description: <em:id>myaddon@example.com</em:id>
- Verify the namespace URI is correct (http://www.mozilla.org/2004/em-rdf#) so the parser can locate the id field
- 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
- Ensure install.rdf has an <em:id> element or em:id attribute
- Use WebExtension manifest.json with applications.gecko.id
- Validate addon structure before installing
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
- Couldn't find manifest.json in ${extension}
- Could not find add-on ID for ${extension}
- Port number must be in the range 1..65535
- Add-on path does not exist: {addon_path}
- Add-on path is neither an XPI nor a directory: {addon_path}
AI-assisted analysis of SeleniumHQ/selenium@aa36b38e69 (2026-08-14).
Data as JSON: /api/errors/25fd3fdced2f1b53.
Report an issue: GitHub.