stablyai/orca · error · BrowserError

browser_error

browser_error

Error message

Unable to determine full-page screenshot bounds

What it means

fullPageScreenshot() calls Page.getLayoutMetrics to obtain content dimensions for the screenshot clip. If neither cssContentSize nor contentSize is present in the response, there are no dimensions to clip to and the screenshot cannot be computed. This occurs on pages with no layout (about:blank, crashed renderer) or before the first paint has happened. The code prefers cssContentSize to avoid HiDPI device-pixel tiling, falling back to contentSize only on older Chromium builds.

Source

Thrown at src/main/browser/cdp-bridge.ts:622

      return { data }
    })
  }

  async fullPageScreenshot(format: 'png' | 'jpeg' = 'png'): Promise<BrowserScreenshotResult> {
    return this.enqueueCommand(async () => {
      const guest = this.getActiveGuest()
      const sender = this.makeCdpSender(guest)
      await this.ensureDebuggerAttached(guest)

      const metrics = (await sender('Page.getLayoutMetrics')) as {
        cssContentSize?: { width: number; height: number }
        contentSize?: { width: number; height: number }
      }
      // Why: screenshot clip uses CSS pixels; on HiDPI, device-pixel contentSize tiles duplicates, so prefer cssContentSize.
      const contentSize = metrics.cssContentSize ?? metrics.contentSize
      if (!contentSize) {
        throw new BrowserError('browser_error', 'Unable to determine full-page screenshot bounds')
      }

      const { data } = (await sender('Page.captureScreenshot', {
        format,
        captureBeyondViewport: true,
        clip: {
          x: 0,
          y: 0,
          width: Math.ceil(contentSize.width),
          height: Math.ceil(contentSize.height),
          scale: 1
        }
      })) as { data: string }

      return { data, format }
    })
  }

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Ensure the page has fully loaded and has visible content before screenshotting.
  2. Navigate to a real http(s) page rather than about:blank or chrome:// pages.
  3. Retry after calling waitForLoad or a short delay.
  4. Verify guest.getURL() is not an internal page before calling fullPageScreenshot().
Defensive patterns

Strategy: validation

Validate before calling

const url = guest.getURL()
if (!url || url.startsWith('about:') || url.startsWith('chrome:')) {
  throw new Error('Cannot screenshot internal page — navigate to real content first')
}
await bridge.fullPageScreenshot(format)

Try / catch

try {
  return await bridge.fullPageScreenshot(format)
} catch (e) {
  if (e instanceof BrowserError && e.code === 'browser_error' && /bounds/.test(e.message)) {
    // page has no layout; retry after waitForLoad or navigate to real content
  }
  throw e
}

Prevention

When it happens

Trigger: Calling fullPageScreenshot() on about:blank, on a page whose renderer process crashed, or immediately after navigation before the first layout/paint cycle completes.

Common situations: Screenshots of internal/devtools pages; racing with navigation; crashed renderer; empty or zero-size content area.

Related errors


AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12). Data as JSON: /api/errors/f68286f11571ca7c. Report an issue: GitHub.