{"record":{"id":"25fd3fdced2f1b53","repo":"SeleniumHQ/selenium","slug":"add-on-id-could-not-be-found","errorCode":null,"errorMessage":"Add-on id could not be found.","messagePattern":"Add-on id could not be found\\.","errorType":"exception","errorClass":"AddonFormatError","httpStatus":null,"severity":"error","filePath":"py/selenium/webdriver/firefox/firefox_profile.py","lineNumber":326,"sourceCode":"                # Remove the namespace prefix from the tag for comparison\n                entry = node.nodeName.replace(em, \"\")\n                if entry in details:\n                    details.update({entry: get_text(node)})\n            if not details.get(\"id\"):\n                for i in range(description.attributes.length):\n                    attribute = description.attributes.item(i)\n                    if attribute.name == em + \"id\":\n                        details.update({\"id\": attribute.value})\n        except Exception as e:\n            raise AddonFormatError(str(e), sys.exc_info()[2])\n\n        # turn unpack into a true/false value\n        if isinstance(details[\"unpack\"], str):\n            details[\"unpack\"] = details[\"unpack\"].lower() == \"true\"\n\n        # If no ID is set, the add-on is invalid\n        if not details.get(\"id\"):\n            raise AddonFormatError(\"Add-on id could not be found.\")\n\n        return details\n","sourceCodeStart":308,"sourceCodeEnd":329,"githubUrl":"https://github.com/SeleniumHQ/selenium/blob/aa36b38e696a0909e973bdf5e2f9031ffe842c4b/py/selenium/webdriver/firefox/firefox_profile.py#L308-L329","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\n<!-- install.rdf with no em:id -->\n<RDF:Description>\n  <em:name>MyAddon</em:name>\n</RDF:Description>\n\n// after\n<RDF:Description>\n  <em:id>myaddon@example.com</em:id>\n  <em:name>MyAddon</em:name>\n</RDF:Description>","handlingStrategy":"validation","validationCode":"import xml.dom.minidom as minidom\ndoc = minidom.parseString(open('install.rdf').read())\ndesc = doc.getElementsByTagName('Description').item(0)\nhas_id = any(a.name.endswith('id') for i in range(desc.attributes.length) for a in [desc.attributes.item(i)])\nif not has_id:\n    print('Warning: install.rdf has no em:id field')","typeGuard":null,"tryCatchPattern":"from selenium.common.exceptions import AddonFormatError\ntry:\n    profile.add_extension(addon_path)\nexcept AddonFormatError as e:\n    if 'id could not be found' in str(e):\n        print('Add em:id to install.rdf or use manifest.json format')","preventionTips":["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"],"tags":["firefox","addon","install-rdf","validation","profile"],"backgroundTag":null,"analyzedSha":"aa36b38e696a0909e973bdf5e2f9031ffe842c4b","analyzedAt":"2026-08-14T02:32:32.244Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}