{"record":{"id":"5354084fd8577ce5","repo":"microsoft/playwright","slug":"mobile-is-not-supported-with-the-firefox-browser","errorCode":null,"errorMessage":"--mobile is not supported with the Firefox browser.","messagePattern":"--mobile is not supported with the Firefox browser\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/playwright-core/src/tools/mcp/config.ts","lineNumber":311,"sourceCode":"\n  // Launch options\n  const launchOptions: playwrightTypes.LaunchOptions = {\n    channel,\n    executablePath: cliOptions.executablePath,\n    headless: cliOptions.headless,\n  };\n\n  // --sandbox was passed, enable the sandbox\n  // --no-sandbox was passed, disable the sandbox\n  if (cliOptions.sandbox !== undefined)\n    launchOptions.chromiumSandbox = cliOptions.sandbox;\n\n  let device = cliOptions.device;\n  if (cliOptions.mobile) {\n    if (device)\n      throw new Error('Cannot use --mobile together with --device, pick one.');\n    if (browserName === 'firefox')\n      throw new Error('--mobile is not supported with the Firefox browser.');\n    device = browserName === 'webkit' ? 'iPhone 17' : 'Pixel 10';\n  }\n\n  if (device && cliOptions.cdpEndpoint)\n    throw new Error('Device emulation is not supported with cdpEndpoint.');\n\n  // Context options\n  const contextOptions: playwrightTypes.BrowserContextOptions = device ? playwright.devices[device] : {};\n\n  if (cliOptions.proxyServer) {\n    const proxy: playwrightTypes.LaunchOptions['proxy'] = { server: cliOptions.proxyServer };\n    if (cliOptions.proxyBypass)\n      proxy.bypass = cliOptions.proxyBypass;\n    // Set on both to ensure CLI takes precedence over any proxy set in the config file\n    // (launchOptions.proxy applies at browser launch, contextOptions.proxy at context creation).\n    launchOptions.proxy = proxy;\n    contextOptions.proxy = proxy;\n  }","sourceCodeStart":293,"sourceCodeEnd":329,"githubUrl":"https://github.com/microsoft/playwright/blob/c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6/packages/playwright-core/src/tools/mcp/config.ts#L293-L329","documentation":"Thrown by configFromCLIOptions() when --mobile is set and the resolved browser is Firefox. The --mobile shorthand maps to a chromium/webkit device preset, and Firefox lacks equivalent mobile device descriptors in Playwright, so the combination is unsupported by design.","triggerScenarios":"Running `playwright mcp --browser firefox --mobile`, or setting both the browser to firefox (via --browser, PLAYWRIGHT_MCP_BROWSER, or config) and --mobile.","commonSituations":"Defaulting to firefox in a config file then adding --mobile on the command line; assuming --mobile works uniformly across browsers; CI matrix that reuses the same flags for every browser.","solutions":["Switch the browser to chromium or webkit if you need mobile emulation, e.g. `--browser chromium --mobile`.","If you must use Firefox, drop --mobile and pass equivalent context options manually (userAgent, viewport, isMobile, etc.).","Audit the config file and PLAYWRIGHT_MCP_BROWSER env var to ensure firefox is not being set implicitly."],"exampleFix":"// before\nplaywright mcp --browser firefox --mobile\n// after\nplaywright mcp --browser chromium --mobile","handlingStrategy":"validation","validationCode":"if (cliOptions.mobile && browserName === 'firefox') {\n  throw new Error('--mobile is unsupported on Firefox; use chromium or webkit.');\n}","typeGuard":"function mobileSupportedFor(browserName?: string): boolean {\n  return browserName === 'chromium' || browserName === 'webkit';\n}","tryCatchPattern":null,"preventionTips":["Keep a per-browser flag matrix so mobile flags are only added for chromium/webkit.","Set the browser explicitly rather than relying on defaults when using --mobile.","Test flag combinations in CI matrix jobs to catch unsupported pairings early."],"tags":["mcp","config","cli","device-emulation","firefox","validation"],"backgroundTag":null,"analyzedSha":"c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6","analyzedAt":"2026-08-12T07:26:36.950Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}