{"record":{"id":"64c08d82ef7eb104","repo":"Panniantong/Agent-Reach","slug":"unsupported-browser-scrub-url-credentials-browse","errorCode":null,"errorMessage":"Unsupported browser: {scrub_url_credentials(browser)}. Supported: {', '.join(SUPPORTED_BROWSERS)}","messagePattern":"Unsupported browser: (.+?)\\. Supported: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"agent_reach/cookie_extract.py","lineNumber":228,"sourceCode":"    browser: str = \"chrome\",\n    *,\n    platform: Optional[str] = None,\n    profile: Optional[str] = None,\n) -> Dict[str, dict]:\n    \"\"\"\n    Extract cookies for one explicitly requested platform.\n\n    The legacy function name is retained for API compatibility, but an\n    all-platform read is intentionally no longer supported.\n\n    Returns:\n        {\"xueqiu\": {\"xq_a_token\": \"xxx\"}}\n    \"\"\"\n    spec = _platform_spec(platform)\n    _require_browser_extractable(spec)\n    browser = browser.lower()\n    if browser not in SUPPORTED_BROWSERS:\n        raise ValueError(\n            f\"Unsupported browser: {scrub_url_credentials(browser)}. \"\n            f\"Supported: {', '.join(SUPPORTED_BROWSERS)}\"\n        )\n    cookie_file = _profile_cookie_file(browser, profile) if profile else None\n    needed_cookies = spec[\"cookies\"]\n    if needed_cookies is None:\n        raise ValueError(\n            f\"Automatic full-domain extraction is disabled for {spec['name']}.\"\n        )\n\n    # Try rookiepy first (Rust-based, more stable), fallback to browser_cookie3\n    use_rookiepy = False\n    if cookie_file is None:\n        try:\n            import rookiepy\n            use_rookiepy = True\n        except ImportError:\n            pass","sourceCodeStart":210,"sourceCodeEnd":246,"githubUrl":"https://github.com/Panniantong/Agent-Reach/blob/93ae1d18c37b707dec053c7c4f9d91cd8ef8943d/agent_reach/cookie_extract.py#L210-L246","documentation":"Raised by extract_all() in agent_reach/cookie_extract.py when the browser string (after .lower()) is not in SUPPORTED_BROWSERS = ('chrome', 'firefox', 'edge', 'brave', 'opera'). The value is scrubbed with scrub_url_credentials before being echoed, so embedded secrets never leak into the message.","triggerScenarios":"Calling extract_all(browser='chromium', ...) or 'Safari', or a typo like 'Chrom' (lowercased to 'chrom' and rejected).","commonSituations":"Assuming any Chromium fork works; passing 'chromium' where 'chrome' is meant; case differences are tolerated by .lower() but name variants are not.","solutions":["Use exactly one of: chrome, firefox, edge, brave, opera (case-insensitive)","Map generic names in your code: 'chromium' -> 'chrome', 'msedge' -> 'edge'","Check the message — it lists the full supported set"],"exampleFix":"# before\nextract_all(browser='chromium', platform='bilibili')  # ValueError\n\n# after\nextract_all(browser='chrome', platform='bilibili')","handlingStrategy":"validation","validationCode":"SUPPORTED_BROWSERS = ('chrome', 'firefox', 'edge', 'brave', 'opera')\nif browser.lower() not in SUPPORTED_BROWSERS:\n    raise ValueError(f'unsupported browser {browser!r}')","typeGuard":"def is_supported_browser(browser: str) -> bool:\n    return browser.lower() in ('chrome', 'firefox', 'edge', 'brave', 'opera')","tryCatchPattern":"try:\n    extract_all(browser=browser, platform=p)\nexcept ValueError as e:\n    if 'Unsupported browser' in str(e):\n        browser = 'chrome'\n    else:\n        raise","preventionTips":["Normalize browser names (chromium->chrome, msedge->edge) in one mapping","Offer a fixed browser list in your UI instead of free text"],"tags":["cookies","browser","validation"],"backgroundTag":null,"analyzedSha":"93ae1d18c37b707dec053c7c4f9d91cd8ef8943d","analyzedAt":"2026-08-14T22:54:06.735Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}