{"record":{"id":"86e614b2e190f221","repo":"unclecode/crawl4ai","slug":"browser-type-self-browser-type-not-supported","errorCode":null,"errorMessage":"Browser type {self.browser_type} not supported","messagePattern":"Browser type (.+?) not supported","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"crawl4ai/browser_manager.py","lineNumber":406,"sourceCode":"            ]\n            if self.headless:\n                flags.append(\"--headless=new\")\n            # Add viewport flag if specified in config\n            if self.browser_config.viewport_height and self.browser_config.viewport_width:\n                flags.append(f\"--window-size={self.browser_config.viewport_width},{self.browser_config.viewport_height}\")\n            # merge common launch flags\n            flags.extend(self.build_browser_flags(self.browser_config))\n        elif self.browser_type == \"firefox\":\n            flags = [\n                \"--remote-debugging-port\",\n                str(self.debugging_port),\n                \"--profile\",\n                self.user_data_dir,\n            ]\n            if self.headless:\n                flags.append(\"--headless\")\n        else:\n            raise NotImplementedError(f\"Browser type {self.browser_type} not supported\")\n        return base + flags\n\n    async def cleanup(self):\n        \"\"\"Cleanup browser process and temporary directory\"\"\"\n        # Set shutting_down flag BEFORE any termination actions\n        self.shutting_down = True\n\n        if self.browser_process:\n            try:\n                # For builtin browsers that should persist, we should check if it's a detached process\n                # Only terminate if we have proper control over the process\n                if not self.browser_process.poll():\n                    # Process is still running\n                    self.browser_process.terminate()\n                    # Wait for process to end gracefully\n                    for _ in range(10):  # 10 attempts, 100ms each\n                        if self.browser_process.poll() is not None:\n                            break","sourceCodeStart":388,"sourceCodeEnd":424,"githubUrl":"https://github.com/unclecode/crawl4ai/blob/7e801521428ee12509994d39151006f64055ebe3/crawl4ai/browser_manager.py#L388-L424","documentation":"While building subprocess launch flags (_get_browser_args / managed browser path), BrowserManager supports only 'chromium' (and 'firefox' with its own flag set); any other browser_type string reaches the else branch and raises NotImplementedError. This constrains the managed-browser (CDP subprocess) path — Playwright's own launch API supports more types, but this manager does not.","triggerScenarios":"BrowserConfig(browser_type='webkit') combined with use_managed_browser=True; browser_type='chrome' or 'edge' (wrong identifier); typos like 'Chromium' (case-sensitive in this branch).","commonSituations":"Assuming any Playwright browser works with the managed CDP mode; porting configs from Playwright where browser_type strings differ; using branded names ('chrome') instead of engine names.","solutions":["Use browser_type='chromium' (default) or 'firefox' when use_managed_browser=True.","For webkit or other engines, disable the managed browser: BrowserConfig(use_managed_browser=False) and let Playwright's standard launch handle it.","Check spelling/casing of browser_type against the supported set."],"exampleFix":"# before\nBrowserConfig(browser_type='webkit', use_managed_browser=True)  # NotImplementedError\n\n# after\nBrowserConfig(browser_type='webkit', use_managed_browser=False)","handlingStrategy":"validation","validationCode":"MANAGED_SUPPORTED = {'chromium', 'firefox'}\nif cfg.get('use_managed_browser') and cfg['browser_type'] not in MANAGED_SUPPORTED:\n    raise ValueError(f\"managed browser supports only {MANAGED_SUPPORTED}, got {cfg['browser_type']}\")","typeGuard":"def supports_managed_browser(browser_type: str) -> bool:\n    return browser_type in {\"chromium\", \"firefox\"}","tryCatchPattern":"try:\n    browser_config = BrowserConfig(browser_type=bt, use_managed_browser=True)\nexcept NotImplementedError:\n    browser_config = BrowserConfig(browser_type=bt, use_managed_browser=False)","preventionTips":["Validate browser_type against {'chromium','firefox'} whenever use_managed_browser=True.","Use engine names, not brand names, and keep casing lowercase.","Cover this branch in config unit tests."],"tags":["browser-manager","validation","browser-type"],"backgroundTag":null,"analyzedSha":"7e801521428ee12509994d39151006f64055ebe3","analyzedAt":"2026-08-14T20:46:20.673Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}