{"record":{"id":"8975684945cbdf1e","repo":"SeleniumHQ/selenium","slug":"expected-zipper-extensions-join-or-got","errorCode":null,"errorMessage":"expected #{Zipper::EXTENSIONS.join(' or ')}, got #{@path.inspect}","messagePattern":"expected #(.+?), got #(.+?)","errorType":"exception","errorClass":"Error::WebDriverError","httpStatus":null,"severity":"error","filePath":"rb/lib/selenium/webdriver/firefox/extension.rb","lineNumber":55,"sourceCode":"        def write_to(extensions_dir)\n          root_dir = create_root\n          ext_path = File.join extensions_dir, read_id(root_dir)\n\n          FileUtils.rm_rf ext_path\n          FileUtils.mkdir_p File.dirname(ext_path), mode: 0o700\n          FileUtils.cp_r root_dir, ext_path\n\n          FileReaper.reap(root_dir) if @should_reap_root\n        end\n\n        private\n\n        def create_root\n          if File.directory? @path\n            @path\n          else\n            unless Zipper::EXTENSIONS.include? File.extname(@path)\n              raise Error::WebDriverError, \"expected #{Zipper::EXTENSIONS.join(' or ')}, got #{@path.inspect}\"\n            end\n\n            @should_reap_root = true\n            Zipper.unzip(@path)\n          end\n        end\n\n        def read_id(directory)\n          read_id_from_install_rdf(directory) || read_id_from_manifest_json(directory)\n        end\n\n        def read_id_from_install_rdf(directory)\n          rdf_path = File.join(directory, 'install.rdf')\n          return unless File.exist?(rdf_path)\n\n          doc = REXML::Document.new(File.read(rdf_path))\n          namespace = doc.root.namespaces.key(NAMESPACE)\n","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/SeleniumHQ/selenium/blob/aa36b38e696a0909e973bdf5e2f9031ffe842c4b/rb/lib/selenium/webdriver/firefox/extension.rb#L37-L73","documentation":"Raised by Firefox::Extension#create_root (Error::WebDriverError) when the path is a file (not a directory) but its extension is not in Zipper::EXTENSIONS (i.e. not .zip or .xpi). The extension loader can only unpack .zip/.xpi archives or use an already-extracted directory.","triggerScenarios":"Passing a .crx, .tar.gz, .json, or extensionless file to add_extension; downloading an addon in a format Firefox/Selenium cannot unpack; pointing at a manifest.json file directly instead of the packaged archive or directory.","commonSituations":"Trying to install a Chrome .crx into Firefox; renaming an archive incorrectly; passing a URL instead of a local archive path.","solutions":["Package the extension as an .xpi or .zip archive, or pass the unpacked extension directory.","If you have a directory build, point add_extension at the directory rather than a file inside it.","Re-download/re-export the addon in the correct format (.xpi for Firefox)."],"exampleFix":"// before\nprofile.add_extension('build/extension.crx')\n\n// after\n# export as xpi, or pass the unpacked dir\nprofile.add_extension('build/extension.xpi')\n# or\nprofile.add_extension('build/unpacked_extension_dir')","handlingStrategy":"validation","validationCode":"ext = File.extname(path)\nif File.directory?(path) || %w[.zip .xpi].include?(ext)\n  profile.add_extension(path)\nelse\n  raise \"extension must be .zip/.xpi or a directory, got #{ext.inspect}\"\nend","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Package Firefox addons as .xpi (or .zip), or pass the unpacked directory.","Do not attempt to install .crx (Chrome) archives into Firefox.","Verify the file extension before constructing an Extension."],"tags":["firefox","extension","addon","archive"],"backgroundTag":null,"analyzedSha":"aa36b38e696a0909e973bdf5e2f9031ffe842c4b","analyzedAt":"2026-08-14T02:32:32.244Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}