Skip to content

Request a stable screenshot API that captures the current rendered frame without waiting for page stability #407

@wuomzfx

Description

@wuomzfx

Summary

I'd like to request a more stable screenshot API in playwright-cli.

Today, playwright-cli screenshot can fail on complex pages because of things like font readiness, pending resource loading, or unstable rendering state.

I also tried bypassing it with run-code + CDP Page.captureScreenshot, but that is still not reliable enough on some real pages.

What I need

I need a screenshot API with this behavior:

  • do not wait for page stability
  • do not wait for fonts or all resources to finish loading
  • just capture whatever is currently rendered in the browser right now
  • if the page is partially rendered, that is fine
  • if resources are still loading, that is also fine
  • returning a valid screenshot is more important than waiting for a "perfect" screenshot

Why this matters

For debugging and E2E evidence collection, an imperfect screenshot is often much better than no screenshot.

Right now, there is no reliable "capture now" API:

  • the built-in screenshot path can fail
  • direct run-code + CDP is also not stable enough as a workaround

Request

Could playwright-cli provide a stable screenshot API or mode whose contract is:

capture the current rendered browser frame as-is, without waiting for page stability, font readiness, or resource completion

Something like:

  • playwright-cli screenshot --capture-now
  • playwright-cli screenshot --no-wait
  • playwright-cli screenshot --best-effort

The exact name is not important. The key is to prioritize operational reliability over screenshot completeness.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions