{"record":{"id":"5fab418713bd850c","repo":"SeleniumHQ/selenium","slug":"cdp-support-for-firefox-has-been-removed-please-s","errorCode":null,"errorMessage":"CDP support for Firefox has been removed. Please switch to WebDriver BiDi.","messagePattern":"CDP support for Firefox has been removed\\. Please switch to WebDriver BiDi\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"py/selenium/webdriver/remote/webdriver.py","lineNumber":463,"sourceCode":"        \"\"\"Execute Chrome Devtools Protocol command and get returned result.\n\n        The command and command args should follow chrome devtools protocol domains/commands:\n          - https://chromedevtools.github.io/devtools-protocol/\n\n        Args:\n            cmd: Command name.\n            cmd_args: Command args. Empty dict {} if there is no command args.\n\n        Returns:\n            A dict, empty dict {} if there is no result to return. To\n            getResponseBody: {'base64Encoded': False, 'body': 'response body\n            string'}\n\n        Example:\n            `driver.execute_cdp_cmd(\"Network.getResponseBody\", {\"requestId\": requestId})`\n        \"\"\"\n        if self.caps[\"browserName\"].lower() == \"firefox\":\n            raise RuntimeError(\"CDP support for Firefox has been removed. Please switch to WebDriver BiDi.\")\n        return self.execute(\"executeCdpCommand\", {\"cmd\": cmd, \"params\": cmd_args})[\"value\"]\n\n    def execute(\n        self,\n        driver_command: str | Generator[dict[str, Any], Any, Any],\n        params: dict[str, Any] | None = None,\n    ) -> Any:\n        \"\"\"Sends a command to be executed by a command.CommandExecutor.\n\n        Args:\n            driver_command: The name of the command to execute as a string.\n                Can also be a BiDi protocol command generator.\n            params: A dictionary of named parameters to send with the command.\n                Ignored when ``driver_command`` is a BiDi generator.\n\n        Returns:\n            The command's JSON response loaded into a dictionary object.\n        \"\"\"","sourceCodeStart":445,"sourceCodeEnd":481,"githubUrl":"https://github.com/SeleniumHQ/selenium/blob/aa36b38e696a0909e973bdf5e2f9031ffe842c4b/py/selenium/webdriver/remote/webdriver.py#L445-L481","documentation":"Raised by `execute_cdp_cmd` when the session's browserName is 'firefox'. Selenium removed Firefox CDP support; the CDP endpoint is Chromium-only, and Firefox users should use the standards-track WebDriver BiDi protocol instead. It is a RuntimeError.","triggerScenarios":"Calling `driver.execute_cdp_cmd(...)` on a Firefox session, or running cross-browser test code that unconditionally uses CDP against a Firefox driver.","commonSituations":"Porting Chrome-only CDP snippets (Network throttling, emulation, JS coverage) to Firefox; shared test helpers that call execute_cdp_cmd without a browser check; older code that relied on Firefox's experimental CDP.","solutions":["Use the WebDriver BiDi API for Firefox: driver.bidi.<module> or the bidi connection.","Gate CDP calls behind a Chromium check: if driver.caps['browserName'].lower() == 'chrome'.","Replace the specific CDP command with a BiDi or cross-browser equivalent."],"exampleFix":"# before\ndriver.execute_cdp_cmd('Network.setCacheDisabled', {'cacheDisabled': True})  # on Firefox\n\n# after (use BiDi, or guard)\nif driver.caps['browserName'].lower() in ('chrome','edge'):\n    driver.execute_cdp_cmd('Network.setCacheDisabled', {'cacheDisabled': True})\nelse:\n    # use WebDriver BiDi equivalents for Firefox","handlingStrategy":"type-guard","validationCode":"is_chromium = driver.caps['browserName'].lower() in ('chrome','edge','chromium')\nif not is_chromium:\n    raise RuntimeError('execute_cdp_cmd is Chromium-only; use WebDriver BiDi for Firefox')","typeGuard":"def supports_cdp(driver) -> bool:\n    return driver.caps.get('browserName','').lower() in ('chrome','edge','chromium')","tryCatchPattern":"if supports_cdp(driver):\n    driver.execute_cdp_cmd(cmd, params)\nelse:\n    # use BiDi path","preventionTips":["Treat CDP as Chromium-only in shared helpers; route Firefox to BiDi.","When migrating off CDP, audit all execute_cdp_cmd call sites for browser guards."],"tags":["cdp","firefox","api-migration","bidi"],"backgroundTag":null,"analyzedSha":"aa36b38e696a0909e973bdf5e2f9031ffe842c4b","analyzedAt":"2026-08-14T02:32:32.244Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}