Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

fromSurface is an optional Boolean parameter of the Chrome DevTools Protocol (CDP) command Page.captureScreenshot. When it is true, CDP captures from the rendered surface rather than the view; the tip-of-tree protocol reference lists true as the default. The parameter is marked experimental, so exact behavior and defaults should be checked against the protocol version and client library you use.

The short answer

A screenshot has a capture source. With fromSurface: true, Chrome asks for the image from the page’s rendered surface. With fromSurface: false, it asks for the view instead. The distinction is separate from image format, clipping, JPEG quality, or whether capture extends beyond the viewport.

If you omit the property, the current tip-of-tree CDP reference documents true as the default. Because the option is experimental, do not treat that default as an immutable promise across Chrome versions, Chromium builds, operating systems, or generated client libraries.

Where the option belongs

The parameter is part of the Page-domain method Page.captureScreenshot. The command returns an object whose data member contains the screenshot as Base64-encoded image data.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
{
  "id": 7,
  "method": "Page.captureScreenshot",
  "params": {
    "fromSurface": true,
    "format": "png"
  }
}

Send that message over the DevTools Protocol connection after attaching to a page target. Decode the returned result.data value and write the bytes to a file.

Explicit values versus omission

  • true: request a surface capture.
  • false: request a view capture.
  • omitted: the tip-of-tree reference says the default is true, but a client may apply its own serialization or compatibility behavior.

For reproducible automation, set the value explicitly and record your Chrome and client-library versions.

Surface and view: what is actually different?

The protocol description is intentionally concise: “Capture the screenshot from the surface, rather than the view.” It defines the source of the capture, not a universal list of pixel-level differences. Surface and view are renderer concepts; the visible result can also be affected by viewport size, device emulation, scale factor, scroll position, overlays, scrollbars, and page state.

Chromium’s browser test provides a useful implementation example, but it is not a cross-platform guarantee. Its comment describes the false case as a capture made without emulation or preference changes, “as-is.” The same test compares it with a surface capture and checks internal scrollbar rendering, referring to the surface path as applying “actual scrollbar magic.” Those comments explain what that test is exercising; they do not prove that every Chrome release will disable every form of emulation when you pass false, or that toggling the flag always changes scrollbars.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What you can safely conclude

  • The flag chooses between two capture sources in Page.captureScreenshot.
  • The documented default is true in the current tip-of-tree protocol.
  • Chromium tests show that source choice can matter for internal scrollbar handling and for the test’s emulation/preferences setup.
  • The protocol does not promise a complete, identical surface-versus-view behavior matrix for every platform and version.

Using the flag in a controlled comparison

When investigating a mismatch, hold every other input constant. Use the same URL, viewport, device scale factor, emulation settings, scroll position, page readiness condition, and Chrome build. Capture once with each explicit value, then compare the files.

  1. Navigate to the target page and wait for the same readiness condition in both runs.
  2. Set viewport and device emulation before calling Page.captureScreenshot.
  3. Send one command with "fromSurface": true and save the decoded data.
  4. Send a second command with "fromSurface": false without changing any other setting.
  5. Inspect scrollbars, fixed elements, clipping, device-pixel scaling, and any emulation-specific differences.
  6. Repeat on the Chrome version and operating system used in production before changing application code.

This procedure is a debugging method inferred from Chromium’s test coverage, not a promise that the two images will differ on your page.

A raw protocol payload

{
  "id": 8,
  "method": "Page.captureScreenshot",
  "params": {
    "fromSurface": false,
    "captureBeyondViewport": false,
    "format": "png"
  }
}

Your CDP transport must supply a valid target session and message identifier. The response is typically shaped like this:

{
  "id": 8,
  "result": {
    "data": "iVBORw0KGgoAAA..."
  }
}

Do not write the Base64 text directly as a PNG; decode it first.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How fromSurface relates to other screenshot parameters

Several options are often confused with fromSurface. They control different stages of capture.

Parameter Purpose Does it select surface or view?
fromSurface Selects the capture source. Yes; this is its role.
clip Limits the image to a specified rectangle. No.
format Chooses JPEG, PNG, or WebP encoding; PNG is documented as the default. No.
quality Sets JPEG compression quality. No; it matters for JPEG output.
captureBeyondViewport Controls capture of content outside the current viewport. No.
optimizeForSpeed Requests an encoding path optimized for speed. No.

If the problem is a blurry JPEG, wrong crop, or missing content below the fold, changing fromSurface is not the first fix. Check the parameter dedicated to that symptom.

Client-library and version cautions

CDP clients generate command parameters from protocol definitions, and wrappers sometimes omit optional fields, rename methods, or supply defaults. A library’s behavior can therefore differ from the protocol document’s serialization. Verify how your library exposes Page.captureScreenshot, whether it accepts fromSurface, and whether it sends an omitted property or an explicit Boolean.

The protocol page cited here is the current tip-of-tree reference, and the option is experimental. Pin a known Chrome/client combination for visual-regression jobs, log the effective parameters, and re-check behavior after browser upgrades.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Troubleshooting

The two modes produce identical files

That is possible. The page may not exercise a code path that distinguishes the sources, or your platform may render both paths identically. Confirm that the commands really contain opposite explicit Booleans and that your client is not dropping the field.

Scrollbars differ unexpectedly

Keep viewport, overflow settings, overlay-scrollbar preferences, scale factor, and Chrome version constant. Chromium’s test specifically examines internal scrollbar rendering on the surface path, so scrollbar differences are a useful comparison point, not proof of a universal rule.

The screenshot ignores device emulation

Check whether your library applies emulation before capture and whether it serializes fromSurface: false as intended. The Chromium test’s comment describes its false case as without emulation and preference changes, but that is test-specific wording, not a general guarantee.

The command fails with an unknown parameter

Your target may expose an older protocol version, or the client may be connected to a non-Chromium implementation. Query the protocol supported by the running browser, update the client if appropriate, and fall back to omitting the experimental field only when your compatibility requirements allow it.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The returned image cannot be opened

Read the response envelope, extract result.data, Base64-decode it, and write the resulting bytes in binary mode. Also verify that the requested format matches the file extension.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

When to choose each value

Use true when

  • You want the documented default surface capture.
  • Your production behavior has been validated with surface screenshots.
  • You are matching a workflow whose scrollbar or surface rendering has been observed and recorded.

Use false when

  • You are deliberately comparing the view path during diagnosis.
  • Your controlled tests show that the view result matches the artifact you need.
  • You have pinned the browser and platform behavior rather than relying on assumptions from one Chromium test.

There is no protocol rule that makes one value universally “better.” Choose the source that matches the rendering semantics your application needs, then keep the choice explicit.

Or skip the browser setup

If you only need a dependable website image rather than direct CDP control, ScreenshotNeo provides a single HTTP request. It accepts consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be disabled. Only clean shots are billed: bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers identify the page verdict and billing result.

See the complete parameter reference in the ScreenshotNeo documentation. A cURL request is:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Python:

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
r.raise_for_status()
open("shot.webp", "wb").write(r.content)

Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`${res.status} ${res.statusText}`);
require('fs').writeFileSync('shot.webp', Buffer.from(await res.arrayBuffer()));

ScreenshotNeo also offers an MCP server for Claude, Cursor, and other MCP clients, with take_screenshot, get_page_info, and capture_pdf tools. Every plan includes its features; 1,000 screenshots per month are free with no card, and paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account to try it.

Key takeaways

  • fromSurface is a Boolean on Page.captureScreenshot, not an image-format switch.
  • The current tip-of-tree reference documents true as the default and marks the parameter experimental.
  • Chromium’s test demonstrates a scoped scrollbar and emulation-related comparison; it is not a cross-platform contract.
  • For diagnosis, compare explicit true and false values under identical conditions and verify your client’s serialization.

Frequently Asked Questions

Does fromSurface control full-page screenshots?

No. Full-page extent is handled by capture settings such as captureBeyondViewport; fromSurface selects the capture source.

Is fromSurface available in every browser automation tool?

Not necessarily. Availability depends on the browser’s CDP version and how the client exposes experimental parameters.

Can I infer a standards-level definition from Chromium’s browser test?

No. The test is valuable implementation evidence, but the protocol’s surface-versus-view description is the broader contract.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.