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

A blank or partly rendered WKWebView screenshot usually means the capture ran before the page was ready, the requested rectangle did not match the current view geometry, or the missing content uses a GPU-rendering path that WebKit’s snapshot does not reproduce. Check the completion error and image first; then verify readiness and geometry before treating the result as a WebKit rendering limitation.

Start by checking what takeSnapshot returned

takeSnapshot(with:completionHandler:) is asynchronous. Its completion handler supplies a platform-native image and an optional error, so a call that returns immediately is not proof that a usable image was produced. Log the error and inspect the image before saving it.

  • No image, with an error: treat this as an API failure. Record the error and correct the capture conditions before retrying.
  • An image with the expected dimensions but transparent, white, or black areas: the API returned an image, but the page may not have finished rendering, the rectangle may be wrong, or some content may not be supported by the snapshot path.
  • An image with the wrong dimensions: check the requested rectangle and snapshotWidth, and distinguish points from output pixels.

Record the image dimensions, scale, and alpha information alongside the error. This separates failure to produce an image from a successful capture of incomplete content, which need different fixes.

Capture after navigation and layout have settled

Run the capture on the main thread or main actor. A navigation delegate’s completion tells you navigation reached a milestone; it does not guarantee that JavaScript-driven layout, web fonts, images, or other dynamic content have finished changing. Wait for the page-specific readiness condition that matters to your app before capturing.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Apple iPad 11-inch: A16 chip, 11-inch Model, Liquid Retina Display, 128GB, Wi-Fi 6, 12MP Front/12MP Back Camera, Touch ID, All-Day Battery Life — Blue
  • WHY IPAD — The 11-inch iPad is now more capable than ever with the superfast A16 chip, a stunning Liquid Retina display, advanced cameras, fast Wi-Fi, USB-C connector, and four gorgeous colors.* iPad delivers a powerful way to create, stay connected, and get things done.
  • PERFORMANCE AND STORAGE — The superfast A16 chip delivers a boost in performance for your favorite activities. And with all-day battery life, iPad is perfect for playing immersive games and editing photos and videos.* Storage starts at 128GB and goes up to 512GB.*
  • 11-INCH LIQUID RETINA DISPLAY — The gorgeous Liquid Retina display is an amazing way to watch movies or draw your next masterpiece.* True Tone adjusts the display to the color temperature of the room to make viewing comfortable in any light.
  • IPADOS + APPS — iPadOS makes iPad more productive, intuitive, and versatile. With iPadOS, run multiple apps at once, use Apple Pencil to write in any text field with Scribble, and edit and share photos.* iPad comes with essential apps like Safari, Messages, and Keynote, with over a million more apps designed specifically for iPad available on the App Store.
  • FAST WI-FI CONNECTIVITY — Wi-Fi 6 gives you fast access to your files, uploads, and downloads, and lets you seamlessly stream your favorite shows.
  1. Wait for the relevant WKNavigationDelegate completion callback.
  2. If the page renders important content asynchronously, use a page-specific signal—for example, a JavaScript-visible readiness flag or the appearance of a required element—rather than assuming navigation completion means the page is visually settled.
  3. If the first rendered frame may still be pending, set afterScreenUpdates to true and schedule the capture on the next run-loop turn.
  4. Inspect the completion result. Retry only after correcting a readiness or geometry problem, rather than immediately issuing repeated captures with unchanged conditions.

Apple documents afterScreenUpdates as controlling whether pending screen updates are included. It is useful when a capture races the first presentation, but it cannot make unsupported GPU content appear or repair an invalid capture rectangle.

A viewport capture in Swift

import WebKit
import UIKit

@MainActor
func captureViewport(of webView: WKWebView) {
    let config = WKSnapshotConfiguration()
    config.rect = webView.bounds
    config.snapshotWidth = NSNumber(value: Float(webView.bounds.width))
    config.afterScreenUpdates = true

    // Give pending layout and screen updates a run-loop turn to settle.
    DispatchQueue.main.async {
        webView.takeSnapshot(with: config) { image, error in
            if let error {
                print("WKWebView snapshot error: (error)")
            }
            guard let image else {
                print("WKWebView snapshot returned no image")
                return
            }
            print("Image size: (image.size), scale: (image.scale)")
            guard let data = image.pngData() else {
                print("Could not encode snapshot as PNG")
                return
            }
            do {
                try data.write(to: URL(fileURLWithPath: NSTemporaryDirectory())
                    .appendingPathComponent("wkwebview.png"))
            } catch {
                print("Could not save snapshot: (error)")
            }
        }
    }
}

This example captures the current viewport. Call it only after the page state you need is ready; the run-loop turn is not a substitute for waiting on asynchronous page content. For a macOS app, use the corresponding AppKit image and file-encoding APIs, while keeping the same checks for the asynchronous result, readiness, and geometry.

Make the capture rectangle and output width defensible

WKSnapshotConfiguration.rect is expressed in the web view’s coordinate system. For an initial diagnostic, use webView.bounds: it tests the visible viewport without assuming that a scroll view’s content dimensions describe a valid snapshot region. A rectangle based on stale measurements, coordinates from another view, or content outside the currently valid geometry can yield an image of plausible size that nevertheless omits or blanks content.

Rank #2
Sale
Apple iPad 11-inch: A16 chip, 11-inch Model, Liquid Retina Display, 128GB, Wi-Fi 6, 12MP Front/12MP Back Camera, Touch ID, All-Day Battery Life — Silver
  • WHY IPAD — The 11-inch iPad is now more capable than ever with the superfast A16 chip, a stunning Liquid Retina display, advanced cameras, fast Wi-Fi, USB-C connector, and four gorgeous colors.* iPad delivers a powerful way to create, stay connected, and get things done.
  • PERFORMANCE AND STORAGE — The superfast A16 chip delivers a boost in performance for your favorite activities. And with all-day battery life, iPad is perfect for playing immersive games and editing photos and videos.* Storage starts at 128GB and goes up to 512GB.*
  • 11-INCH LIQUID RETINA DISPLAY — The gorgeous Liquid Retina display is an amazing way to watch movies or draw your next masterpiece.* True Tone adjusts the display to the color temperature of the room to make viewing comfortable in any light.
  • IPADOS + APPS — iPadOS makes iPad more productive, intuitive, and versatile. With iPadOS, run multiple apps at once, use Apple Pencil to write in any text field with Scribble, and edit and share photos.* iPad comes with essential apps like Safari, Messages, and Keynote, with over a million more apps designed specifically for iPad available on the App Store.
  • FAST WI-FI CONNECTIVITY — Wi-Fi 6 gives you fast access to your files, uploads, and downloads, and lets you seamlessly stream your favorite shows.

snapshotWidth controls the output width in points. Do not treat it as a pixel-width setting. Image scale affects the relationship between points and pixels, so log both the returned image size and scale when comparing expected output dimensions.

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

For a full-page capture

A full page is not simply a larger viewport rectangle. First let layout settle, then measure the final document dimensions from JavaScript. Build a capture plan from those measurements, ensure the view is laid out consistently with the requested rectangle, and avoid relying on a previously cached scrollView.contentSize when the page may have changed.

  1. Wait for navigation and page-specific dynamic content to finish.
  2. Measure the document’s final dimensions after layout.
  3. Choose a bounded capture region that is valid in the WKWebView coordinate system.
  4. Set the requested output width deliberately, then verify the returned image dimensions and content.

Very long pages, lazy-loaded images, and GPU-heavy layouts add further moving parts. A measured document height does not guarantee that one arbitrarily large snapshot will render every item. Where coverage matters, consider a bounded capture plan and test it with the actual page types your app supports.

Rank #3
Sale
Apple iPad 11-inch: A16 chip, 11-inch Model, Liquid Retina Display, 128GB, Wi-Fi 6, 12MP Front/12MP Back Camera, Touch ID, All-Day Battery Life — Pink
  • WHY IPAD — The 11-inch iPad is now more capable than ever with the superfast A16 chip, a stunning Liquid Retina display, advanced cameras, fast Wi-Fi, USB-C connector, and four gorgeous colors.* iPad delivers a powerful way to create, stay connected, and get things done.
  • PERFORMANCE AND STORAGE — The superfast A16 chip delivers a boost in performance for your favorite activities. And with all-day battery life, iPad is perfect for playing immersive games and editing photos and videos.* Storage starts at 128GB and goes up to 512GB.*
  • 11-INCH LIQUID RETINA DISPLAY — The gorgeous Liquid Retina display is an amazing way to watch movies or draw your next masterpiece.* True Tone adjusts the display to the color temperature of the room to make viewing comfortable in any light.
  • IPADOS + APPS — iPadOS makes iPad more productive, intuitive, and versatile. With iPadOS, run multiple apps at once, use Apple Pencil to write in any text field with Scribble, and edit and share photos.* iPad comes with essential apps like Safari, Messages, and Keynote, with over a million more apps designed specifically for iPad available on the App Store.
  • FAST WI-FI CONNECTIVITY — Wi-Fi 6 gives you fast access to your files, uploads, and downloads, and lets you seamlessly stream your favorite shows.

Decide whether the missing area is ordinary HTML or a GPU limitation

If text and ordinary page elements render but video, WebGL, or an effect-heavy region is black or absent, changing the rectangle or adding a delay may not help. WebKit issue 198107 describes HTML5 video and WebGL appearing as a black portion of the snapshot while surrounding page content remained visible. The report concerns iOS 12.2 with AppleWebKit 605.1.15; it was modified on 2025-06-08 and marked NEW at that time. It documents a specific report, not a measured failure rate or a guarantee about every current OS release.

WebKit issue 221662 describes missing 3D perspective, filters, reflections, and other GPU-rendered features. It was reported against Safari 14 on macOS 11 in 2021. These reports make such content a fidelity risk, not proof that every page or current platform version will fail in the same way. A snapshot API should not be assumed to reproduce hardware-composited pixels.

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.

Practical alternatives for affected content

  • Use a poster image or other static representation instead of live video for the capture state.
  • Render a static DOM representation when the goal is a document preview rather than a literal rendering of animation or GPU effects.
  • Use a dedicated media or frame-extraction path if the media frame itself is what must be captured.
  • Use a visible-window capture only when the platform, overlap, clipping, and privacy constraints are acceptable.

Each option changes what is being captured. A poster or static DOM may give a more dependable preview but is not a pixel-for-pixel capture of the live GPU-rendered page.

Rank #4
Sale
Apple iPad Pro 11-inch (M5): Ultra Retina XDR Display, 256GB, Landscape 12MP Front Camera/12MP Back Camera, LiDAR Scanner, Wi-Fi 7 with Apple N1, Face ID, All-Day Battery Life — Space Black
  • WHY IPAD PRO — iPad Pro with the Apple M5 chip delivers extraordinary performance for effortless productivity on a stunning display. Take on pro workflows with Neural Accelerators for AI and a redesigned iPadOS with game-changing capabilities.*
  • PERFORMANCE AND STORAGE — iPad Pro with M5 brings next-generation speed and the power of on-device AI to all your tasks.* Featuring up to 2TB of storage, 16GB of memory, and Neural Accelerators for next-level AI performance.*
  • IPADOS — Run pro apps and get more done with iPadOS 26 with Liquid Glass design and game-changing capabilities.* With an intuitive and flexible windowing system, you can control, organize, and manage your workflows like never before.
  • APPLE INTELLIGENCE — Apple Intelligence is the personal intelligence system that helps you communicate, express yourself, and get things done effortlessly with groundbreaking privacy protections at every step.*
  • 11-INCH ULTRA RETINA XDR DISPLAY — The world’s most advanced display, featuring extreme brightness, precise contrast, ProMotion, P3 wide color, and True Tone.* Nano-texture display glass available in 1TB and 2TB configurations

Use view-rendering fallbacks only when their constraints fit

Replacing takeSnapshot with another view API is not a universal fix. WebKit issue 161450 records white or empty results from AppKit cacheDisplayInRect, layer rendering, and PDF-based approaches to capturing WKWebView. It also records that CGWindowListCreateImage may capture only visible portions of a parented window and can fail for clipped, overlapped, or scroll-view content.

drawViewHierarchy or window capture can be considered when you can meet the relevant visibility and overlap requirements and have verified the result on the target platform. They are fallbacks with constraints, not equivalent ways to capture hidden or off-screen WebKit content. For ordinary page content, keep the public asynchronous takeSnapshot path as the baseline.

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

Troubleshoot by symptom

Symptom Likely area to check Next step
Completion has no image and an error API failure or capture conditions Log the error, confirm the call is on the main actor, and retry after correcting readiness or geometry.
Image exists but is transparent or mostly blank Page not presented yet, stale rectangle, or missing off-screen content Wait for page readiness, enable afterScreenUpdates, and test with webView.bounds.
Ordinary content appears but video or WebGL is black GPU-composited content Try a poster/static representation or an appropriate media capture path; do not expect a timing delay to repair an unsupported rendering path.
Only part of a long page appears Full-page geometry, lazy loading, or an oversized capture Measure after layout, ensure the rect is valid in web-view coordinates, and use a bounded capture plan.
Fallback image omits overlapped or clipped content Visibility and window-capture limits Use a visible, unobstructed view if that fallback is acceptable, or return to takeSnapshot for ordinary WebKit page content.

Or skip the browser setup

If your actual goal is to capture a public website from a script or service—not to inspect the pixels inside your app’s native WKWebView—ScreenshotNeo offers a website screenshot API. It does not fix a native WKWebView rendering limitation. One GET request can return an image or PDF; for example, save a WebP screenshot of a page with cURL (see the ScreenshotNeo API documentation):

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Sale
Apple iPad, 10.2-Inch, Wi-Fi, 32GB, Space Gray (Renewed)
  • Smart Connector. 3.5 mm headphone jack. Stereo speakers. On/Off - Sleep/Wake. Home/Touch ID sensor. Dual microphones. Volume up/down. Nano-SIM tray (cellular models). Lightning connector
  • A10 Fusion chip.
  • Touch ID fingerprint sensor,
  • 8MP back camera, 1. 2MP FaceTime HD front camera.
  • Stereo speakers.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

ScreenshotNeo removes cookie and consent banners, newsletter popups, and chat widgets before capture; each cleanup step can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers report the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents. The Free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000 screenshots.

Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.

Frequently Asked Questions

Does setting afterScreenUpdates to true wait for JavaScript or network activity to finish?

No. It controls inclusion of pending screen updates; page-specific asynchronous work still needs its own readiness check.

Can takeSnapshot capture a WKWebView that is hidden?

Do not assume so. The documented diagnostic path depends on page readiness and valid view geometry, and view/window fallbacks have visibility constraints.

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.

Is a black video region proof that my rectangle is wrong?

No. WebKit issue 198107 documents black video and WebGL regions alongside visible surrounding HTML, so a GPU-content limitation is also plausible.

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.