{"record":{"id":"f68286f11571ca7c","repo":"stablyai/orca","slug":"browser-error-f68286","errorCode":"browser_error","errorMessage":"Unable to determine full-page screenshot bounds","messagePattern":"Unable to determine full-page screenshot bounds","errorType":"exception","errorClass":"BrowserError","httpStatus":null,"severity":"error","filePath":"src/main/browser/cdp-bridge.ts","lineNumber":622,"sourceCode":"\n      return { data }\n    })\n  }\n\n  async fullPageScreenshot(format: 'png' | 'jpeg' = 'png'): Promise<BrowserScreenshotResult> {\n    return this.enqueueCommand(async () => {\n      const guest = this.getActiveGuest()\n      const sender = this.makeCdpSender(guest)\n      await this.ensureDebuggerAttached(guest)\n\n      const metrics = (await sender('Page.getLayoutMetrics')) as {\n        cssContentSize?: { width: number; height: number }\n        contentSize?: { width: number; height: number }\n      }\n      // Why: screenshot clip uses CSS pixels; on HiDPI, device-pixel contentSize tiles duplicates, so prefer cssContentSize.\n      const contentSize = metrics.cssContentSize ?? metrics.contentSize\n      if (!contentSize) {\n        throw new BrowserError('browser_error', 'Unable to determine full-page screenshot bounds')\n      }\n\n      const { data } = (await sender('Page.captureScreenshot', {\n        format,\n        captureBeyondViewport: true,\n        clip: {\n          x: 0,\n          y: 0,\n          width: Math.ceil(contentSize.width),\n          height: Math.ceil(contentSize.height),\n          scale: 1\n        }\n      })) as { data: string }\n\n      return { data, format }\n    })\n  }\n","sourceCodeStart":604,"sourceCodeEnd":640,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/src/main/browser/cdp-bridge.ts#L604-L640","documentation":"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.","triggerScenarios":"Calling fullPageScreenshot() on about:blank, on a page whose renderer process crashed, or immediately after navigation before the first layout/paint cycle completes.","commonSituations":"Screenshots of internal/devtools pages; racing with navigation; crashed renderer; empty or zero-size content area.","solutions":["Ensure the page has fully loaded and has visible content before screenshotting.","Navigate to a real http(s) page rather than about:blank or chrome:// pages.","Retry after calling waitForLoad or a short delay.","Verify guest.getURL() is not an internal page before calling fullPageScreenshot()."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const url = guest.getURL()\nif (!url || url.startsWith('about:') || url.startsWith('chrome:')) {\n  throw new Error('Cannot screenshot internal page — navigate to real content first')\n}\nawait bridge.fullPageScreenshot(format)","typeGuard":null,"tryCatchPattern":"try {\n  return await bridge.fullPageScreenshot(format)\n} catch (e) {\n  if (e instanceof BrowserError && e.code === 'browser_error' && /bounds/.test(e.message)) {\n    // page has no layout; retry after waitForLoad or navigate to real content\n  }\n  throw e\n}","preventionTips":["Ensure the page has loaded and painted before calling fullPageScreenshot().","Avoid screenshotting internal pages (about:blank, chrome://) that report no content dimensions.","Retry after a short delay if the page is still laying out."],"tags":["screenshot","cdp","layout","hidpi"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}