DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
html2canvas

Why WebGL Content Cannot Be Downloaded with html2canvas (and What Actually Works)

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.

html2canvas cannot reliably download WebGL pixels because it reconstructs a new image from readable DOM data instead of capturing the browser’s composited screen. A WebGL canvas is rendered through a GPU drawing buffer, and that buffer is normally cleared after the browser composites a frame. If you export later with toDataURL(), there may be no frame left to read. Cross-origin restrictions can cause a separate failure.

This distinction explains both common symptoms: a screenshot that omits the 3D scene and a downloaded PNG that is blank. The correct fix depends on whether you control the WebGL renderer or need a screenshot of the whole page exactly as a user sees it.

What html2canvas is—and why that matters for WebGL

html2canvas documentation describes its output as DOM-based. It walks the document, reads supported styles and resources, and paints a new representation into another canvas. It does not ask the browser for the final pixels in the tab.

That approach works well for ordinary HTML, text, backgrounds and many images. It cannot automatically reproduce every result produced by a GPU API. WebGL draws into a drawing buffer that is composited by the browser; the rendered pixels are not represented as child DOM nodes for html2canvas to inspect. Consequently, the HTML screenshot can contain the canvas element’s box while the actual 3D content is transparent, black or missing.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
ARDIYES GT 740 4GB GDDR5 Low Profile GPU Graphics Card, 4X HDMI Ports for Quad Multi-Monitor Setup, PCI Express 3.0 x16, Silent Cooling, Ideal for Office and Home Theater
  • Robust 4GB Memory & Quad Display Ready: Equipped with 4GB of fast GDDR5 memory to smoothly handle daily graphics tasks. Features four built-in HDMI ports, enabling a seamless quad-monitor setup directly out of the box—perfect for multi-tasking offices, digital signage, or trading desks.
  • Plug-and-Play Installation & Wide Compatibility: Utilizes a standard PCI Express interface for broad compatibility with most desktop PCs. Offers straightforward plug-and-play installation and stable driver support for modern Windows and Linux operating systems, ensuring a hassle-free setup.
  • Quiet, Cool & Compact Design: Engineered with a silent fan and efficient cooling system for near-silent operation, making it ideal for noise-sensitive environments. Its low-profile design fits easily into small form factor cases, with both half-height and full-height brackets included for flexible installation.
  • Enhanced Multimedia & Everyday Performance: Delivers smooth 1080P video playback and supports hardware-accelerated decoding, offering an excellent experience for home theater PCs (HTPC). Provides capable performance for everyday applications, multimedia tasks.
  • Complete Package & Reliable Support: Includes the graphics card, both low-profile and standard brackets, a quick start guide, and screwdriver, which make it simple and quick setup process.

The project states the limitation plainly: its screenshot is based on the DOM and “does not make an actual screenshot, but builds the screenshot based on the information available on the page.” Treat this as a rendering-model limitation, not a failed download.

Why a WebGL canvas may be empty when you read it

The drawing buffer is transient by default

The Khronos WebGL specification says that, by default, the drawing buffer is cleared to its default values after compositing. In practical terms, the browser can present the frame and then discard the buffer before a later callback calls readPixels() or toDataURL().

When a context is created with preserveDrawingBuffer: false (the default), the specification warns that reading the canvas after the rendering function returns can have undefined behavior. A later export may therefore produce a blank or stale image even though the user saw the scene.

Preservation is a creation-time choice

You can request preservation when creating the context:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const gl = canvas.getContext('webgl', { preserveDrawingBuffer: true });

With the flag enabled, the contents remain until you clear or overwrite them. It is not a switch you can safely apply to an already-created context; recreate the context and initialize your resources again. Preservation can also impose a significant performance cost on some platforms, so measure your application rather than enabling it globally.

Cross-origin tainting is a different problem

If the WebGL scene or a 2D canvas uses images, textures or other resources from another origin without suitable CORS headers, browser content policy can block readback. This is independent of html2canvas’s DOM reconstruction. html2canvas recommends useCORS: true when the remote server sends appropriate CORS headers, or a proxy for eligible resources. Neither option turns html2canvas into a native screen-capture API.

Choose the capture method by what you control

Goal Best-fit method Important trade-off
You own the renderer and need one frame’s pixels Synchronous readback during rendering Capture timing must stay inside the render function
You own the renderer and need repeated exports Render to a WebGL framebuffer object, then read it Requires framebuffer setup and a readback path
You can recreate the context and accept overhead preserveDrawingBuffer: true May reduce performance on some hardware
You need the whole visible tab Native extension screenshot API Extension permissions and visible-tab scope apply
You need server-side or automated captures Puppeteer or Playwright Runs a real browser and must wait for the scene to render

Fix 1: read pixels synchronously while rendering

If you control the WebGL code, perform readback before the render function returns, while the drawing buffer still contains the frame. The exact format and buffer size depend on your context and shader output.

function renderAndCapture(gl, canvas) {
  drawScene(gl);                 // issue all WebGL drawing commands
  gl.flush();

  const pixels = new Uint8Array(canvas.width * canvas.height * 4);
  gl.readPixels(
    0, 0, canvas.width, canvas.height,
    gl.RGBA, gl.UNSIGNED_BYTE, pixels
  );

  // pixels is bottom-to-top; flip rows before encoding for most image formats.
  return pixels;
}

Readback is synchronous and can stall the GPU. Do it only when a capture is requested, not on every animation frame. If you encode the data yourself, remember that WebGL’s origin is normally at the bottom-left, so rows often need to be vertically flipped.

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

Fix 2: render into a framebuffer object

A framebuffer gives you an explicit render target rather than relying on the default drawing buffer. Attach a color texture or renderbuffer, render the scene there, and call readPixels() while that framebuffer is bound. You can then display the same texture on screen and read a stable target for export.

gl.bindFramebuffer(gl.FRAMEBUFFER, captureFramebuffer);
drawScene(gl);
const pixels = new Uint8Array(width * height * 4);
gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
gl.bindFramebuffer(gl.FRAMEBUFFER, null);

Check framebuffer completeness with gl.checkFramebufferStatus(gl.FRAMEBUFFER), match the attachment dimensions to the read area, and handle multisampled targets by resolving them into a readable framebuffer first. This design keeps capture timing explicit and avoids depending on whether the browser preserved the presentation buffer.

Fix 3: request preserveDrawingBuffer

When changing the renderer is easier than adding a capture framebuffer, create the context with preservation enabled:

const canvas = document.querySelector('#scene');
const gl = canvas.getContext('webgl', {
  preserveDrawingBuffer: true
});
// initialize shaders, buffers and textures, then render
render();
const pngUrl = canvas.toDataURL('image/png');

This can make a later export work, but it is not free. The WebGL specification notes significant performance loss on some platforms. Use it for an export mode or occasional capture when possible, and profile on the devices you support. If another library creates the context first, setting the option afterward will not change that existing context.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
QTHREE GeForce GT 210 Graphics Card,1024 MB DDR3 64 Bit,HDMI,VGA,Low Profile Video Card for PC,GPU,PCI Express 2.0 x16,SFF,Low Power
  • The Geforce 210 is with a 589MHz core clock,up to 1066Mbps effective,perfect for working,video and photo editing,allows good fluency,which can effectively meet your needs.
  • PCI Express 2.0 interface,offers compatibility with a range of systems. Also includes VGA and HDMI outputs for expanded connectivity,supports up to 2 monitors.Good for adding a simple low profile gpu to a small form factor pc.
  • The computer graphics cards is small in size and saves more space,easy to install,plug and play,you can build a compact PC system easily for slim/ITX chassis.
  • This low profile video card is good value option for entry level, if you just want basic upgrade graphics and daily simple work for your computer, or not be AAA gamer.(include low profile bracket)
  • No external power supply and the all-solid-state capacitor keeps low power consumption and high performance,supports Windows 10/8/7/Vista/XP(not compatible with windows 11).

Why changing html2canvas options rarely solves WebGL

Options such as backgroundColor, scale and useCORS affect the reconstructed output or eligible resource loading. They do not provide access to pixels that were never in the DOM representation. You may layer a separately exported WebGL image over an html2canvas result, but that requires you to capture the WebGL canvas yourself and align dimensions, device-pixel ratio and transparency.

A practical hybrid is:

  1. Capture the ordinary page with html2canvas.
  2. Capture the WebGL framebuffer or preserved canvas at the same CSS size.
  3. Composite the WebGL bitmap at the canvas element’s coordinates.
  4. Export the final 2D canvas.

Keep both captures synchronized with the same scene state. A moving animation, different device-pixel ratio or delayed texture load can otherwise produce a visibly mismatched result.

When you need the browser’s actual composited pixels

Browser extensions

For an extension that needs what the user sees, the html2canvas FAQ points to native APIs: chrome.tabs.captureVisibleTab() for Chrome, Edge and Opera, and browser.tabs.captureVisibleTab() for Firefox. Configure the manifest permissions required by your browser version and capture the intended window or tab. This captures the visible tab, so scroll position, occlusion and browser UI scope matter.

Server-side automation

For scheduled or backend screenshots, use a real browser through Puppeteer or Playwright, as the FAQ recommends. Wait for WebGL initialization and a rendered frame before taking the screenshot:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
await page.goto('https://example.com/scene', { waitUntil: 'networkidle' });
await page.waitForFunction(() => window.sceneReady === true);
await page.screenshot({ path: 'scene.png', fullPage: true });

Your page must expose a reliable readiness signal or selector. A network-idle event alone does not guarantee that shaders compiled, textures uploaded or the first animation frame completed. Headless GPU availability, sandbox settings and browser launch flags also affect WebGL; test the same browser build and container used in production.

Downloading an html2canvas result

If the output already contains everything you need, downloading it is straightforward:

Rank #4
Glorto GeForce GT 730 4G Low Profile Graphics Card, 2X HDMI, DP, VGA, DDR3, PCI Express 2.0 x8, Entry Level GPU for PC, SFF and HTPC, Compatible with Windows 11
  • Powered by NVIDIA GeForce GT 730, 28nm GK208 chipset process with 902MHz core frequency, integrated with 4096MB DDR3 memory and 64-bit bus width
  • More stable performance, compatible with Win11, can automatically install new driver
  • Support NVIDIA Surround technology for 4 screens output by dual HDMI and VGA / DP. HDMI Max Resolution-2560x1600, VGA Max Resolution-2048x1536, DP Max Resolution-2560x1600
  • Support DirectX 12, OpenGL 4.6, CUDA, OpenCL, DirectCompute and DirectML
  • Original half height bracket matches with the low profile brackets make the Glorto GeForce GT 730 graphics card fit well with all PC tower, small form factor and HTPC(except micro form factor)
html2canvas(document.body).then(canvas => {
  const link = document.createElement('a');
  link.download = 'page.png';
  link.href = canvas.toDataURL('image/png');
  link.click();
});

This saves the canvas html2canvas generated. It cannot restore WebGL pixels omitted during DOM reconstruction, and it can still throw a security error if the resulting canvas is tainted by disallowed cross-origin content.

Or skip the browser setup

For a server-side page screenshot, ScreenshotNeo makes one HTTP request to a real browser-backed screenshot API. It removes cookie-consent banners, newsletter popups and chat widgets before capture; bot checks, blank pages, failed loads and timeouts are not billed, and cache hits are free. Its MCP server provides take_screenshot, get_page_info and capture_pdf tools for Claude, Cursor and other MCP clients. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots.

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

Use the DIY renderer fixes above when you need raw WebGL pixels inside your own application. Use ScreenshotNeo when the requirement is a clean image of a URL as a browser renders it.

See the complete parameters in the ScreenshotNeo documentation. A minimal call is:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

You can also request PNG, JPEG or PDF and configure viewport, full-page capture, waits, selectors, device presets, cookies, headers, user agent, timezone, geolocation, custom JavaScript, blocking rules, caching and signed links. Every response identifies the page verdict and whether it was billed.

Create a free ScreenshotNeo account to get 1,000 screenshots a month with no credit card.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting checklist

“The WebGL canvas is missing, but the rest of the page is present.”

  • Confirm that you are not expecting html2canvas to capture final composited pixels.
  • Export the WebGL canvas separately using synchronous readback, a framebuffer, or a preserved buffer.
  • Composite the exported image with the html2canvas result if you need one file.

“toDataURL() returns a blank image.”

  • Call it during rendering or recreate the context with preserveDrawingBuffer: true.
  • Check that the canvas has nonzero drawing dimensions and that rendering completed.
  • Look for cross-origin resources that tainted the canvas.

“useCORS: true did not help.”

The remote server must send compatible CORS headers, and the resource must be loaded with the appropriate mode. This option addresses eligible cross-origin assets; it does not change html2canvas’s capture model or preserve WebGL’s drawing buffer.

Best Value
QTHREE GeForce GT 730 4GB Graphics Card,2X HDMI, DP,VGA,DDR3,64 Bit,Low Profile Video Card for PC,Computer GPU,PCI Express X8,SFF,DirectX 12,Support Winows 11
  • NVIDIA GT 730 graphics cards offer basic display capabilities for office work and light multimedia,which with 1000 MHz Memory Clock 4GB DDR3 on Kepler architecture, support multiple monitors and HD video playback,easily upgrading for convenient usage to save your budget for your old pc
  • The low-profile design of the PC graphics card saves installation space, easy to install,plug &play,making it easy to build a compact computer system, even compatible with ITX chassis.
  • The 4x outputs enables multi-monitor productivity on up to 4 monitors simultaneously,including 2x HDMI,VGA,DP.Designed for full-size chassis and small case installations.
  • PCI Express based PC is required with one X8 lane graphics slot available on the motherboard. 300 Watt or greater power supply. This video card can automatically install new drivers and support Win11,DirectX 12.
  • 30W low power,no external power supply and the all-solid-state capacitor keeps low power consumption and high performance.If you have any problems about this card,please contact us via amazon messages.

“Automation captures a black or uninitialized scene.”

  • Wait for a scene-ready signal, not just navigation.
  • Verify WebGL support in the deployed browser and container.
  • Capture after at least one completed render frame and ensure the target is in the viewport for visible-only captures.

Performance and reliability notes

GPU readback can block until rendering finishes; limit captures and prefer an off-screen framebuffer when the application needs predictable export behavior. Preserving the default drawing buffer may cost performance on some platforms. Native extension captures and Playwright/Puppeteer screenshots capture composited output, but their scope differs: an extension normally captures a visible tab, while automation can target a page, viewport and full-page layout under your control. No universal benchmark applies across browsers, GPUs and scenes, so validate the chosen path in your deployment environment.

Frequently Asked Questions

Can html2canvas capture a WebGL canvas at all?

Not as a native screenshot. It may capture the canvas element’s DOM box, but reliable WebGL pixels require separate readback or a browser screenshot.

Is preserveDrawingBuffer always the best fix?

No. It is simple when you control context creation, but it can reduce performance. Synchronous readback or a framebuffer is often better for an export-only path.

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

Does downloading with toDataURL make the image complete?

It only downloads pixels already present in the canvas. It cannot recover WebGL content html2canvas never represented.

The Bottom Line

html2canvas omits WebGL because it rebuilds DOM content instead of capturing the browser’s final display, while WebGL’s drawing buffer is normally cleared after compositing. Capture during rendering, use a framebuffer, preserve the buffer with its performance trade-off, or use a native browser screenshot workflow. For URL-based server captures without browser setup, ScreenshotNeo is the direct alternative.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

Read next

Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.