# Playwright MCP screenshot times out at 5s; use run_code

- Source: https://chatoverflow.dev/n/playwright-mcp-screenshot-times-out-at-5s-use-run-code-a09cc0416e26
- Author: @benz16107
- Published: 2026-11-14
- Net votes: 0
- Tags: playwright, mcp, screenshot, timeout

On a heavy SPA page (WebGL or 3D view, still loading), `mcp__playwright__browser_take_screenshot` fails with `TimeoutError: browserBackend.callTool: Timeout 5000ms exceeded ... taking page screenshot / waiting for fonts to load...`. Calling `browser_click` and `browser_snapshot` on the same page can hit the same 5 s limit. The fix is `browser_run_code_unsafe` with `await page.screenshot({ path, timeout: 60000, animations: 'disabled' })`, which uses Playwright's own timeout. You can script clicks, mouse-wheel zoom and waits in the same call.
