Use Playwright inside your Bun project for a documented full-page screenshot: navigate a page, then call page.screenshot({ path: "page.png", fullPage: true }). Playwright defines this as a screenshot of the full scrollable page, and its fullPage option defaults to false, so you must enable it explicitly.
Bun.WebView also has view.screenshot(), but Bun documents that method as capturing the current viewport. Its documentation does not establish a native fullPage option. Use WebView for viewport images, or use Playwright when the output must include the entire document.
Choose the right Bun screenshot API
| Requirement | Use | Why |
|---|---|---|
| One image containing the complete scrollable document | Playwright | Its documented fullPage: true option captures the full page. |
| Only the currently visible viewport | Bun.WebView |
view.screenshot() is documented for the current viewport. |
| Capture a specific element | Playwright locator or element screenshot | Element scope is different from full-page scope. |
| Hosted capture without managing a browser | ScreenshotNeo | A single HTTP request returns a screenshot or PDF and handles browser-side cleanup. |
Bun labels Bun.WebView experimental, so its behavior can change between releases. On macOS it uses the system WKWebView; on Linux and Windows it drives an installed Chrome, Chromium, Edge or Brave browser through the Chrome DevTools Protocol.
Take a full-page screenshot with Playwright in Bun
Minimal TypeScript script
Place this in a Bun project as screenshot.ts. The code uses Playwright’s documented API; check the current Playwright installation documentation for the package and browser setup appropriate to your Bun version and operating system rather than relying on an unverified, version-pinned command.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Fix the driver behind crashes, sound loss and screen glitches3Clear out junk files and repair common Windows errors#1 Best Overall
import { chromium } from "playwright";
const browser = await chromium.launch();
const page = await browser.newPage({
viewport: { width: 1440, height: 900 },
deviceScaleFactor: 1
});
await page.goto("https://example.com", { waitUntil: "networkidle" });
await page.screenshot({
path: "page.png",
fullPage: true
});
await browser.close();
Run the file with Bun’s normal TypeScript execution command for your project. The result is page.png in the current directory. The browser page is 1,440 by 900 CSS pixels for its viewport, but fullPage: true extends the captured image to the document’s full scrollable height.
Make navigation and readiness explicit
networkidle is useful for pages that load assets after navigation, but it is not a guarantee that every application has finished rendering. For a known UI state, wait for a selector as well:
await page.goto("https://example.com/catalog", { waitUntil: "domcontentloaded" });
await page.locator("main").waitFor();
await page.screenshot({ path: "catalog.png", fullPage: true });
If the page has animations, rotating banners or continuously polling requests, wait for the specific content you need instead of depending solely on network-idle detection. A fixed delay can be used when there is no reliable selector, but it makes captures slower and can still be wrong when load times vary.
Control the output image
Playwright can write screenshot bytes to a buffer when you need to upload or process the image instead of saving it directly:
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →const image = await page.screenshot({ fullPage: true });
await Bun.write("page.png", image);
That buffer approach is useful for object storage, hashing, or an HTTP response. Element screenshots and viewport screenshots are separate scopes; neither replaces fullPage: true when the requirement is the complete document.
Rank #2
- HTML CSS Design and Build Web Sites
- Comes with secure packaging
- It can be a gift option
Use Bun.WebView for a viewport screenshot
The simplest documented Bun flow creates a WebView, navigates, captures the current viewport, and writes the returned bytes:
await using view = new Bun.WebView();
await view.navigate("https://example.com");
await Bun.write("page.png", await view.screenshot());
Bun documents PNG as the default. JPEG can be selected with adjustable quality, and WebP is available for the Chrome backend. Depending on the encoding option, screenshot output can be returned as a Blob, Buffer, base64 string or shared-memory reference. These choices change representation, not capture height: the documented call remains a viewport screenshot.
Why this is not a documented full-page call
A full-page capture must include content below the visible viewport. Bun’s WebView screenshot documentation describes the current viewport and does not document a fullPage parameter. Therefore, do not treat an encoding setting, a taller viewport, or the WebView screenshot method itself as an official full-document feature.
If you must remain solely on Bun.WebView
You could design a custom scroll-and-stitch process, but it is an application-specific workaround rather than a documented Bun feature. It must scroll through the page, capture overlapping regions, assemble them, and handle issues such as sticky headers, changing content, lazy-loaded images and inconsistent page heights. Dynamic pages can move while you capture, producing seams or missing content. The official documentation reviewed here does not prescribe or validate a particular stitching algorithm, so use Playwright for a supported one-call full-page option when possible.
Make full-page captures reliable
Wait for lazy content
Some sites load images only after they approach the viewport. A full-page screenshot can therefore contain placeholders unless the page has been scrolled or the application exposes a completion signal. Prefer a page-specific ready selector, and verify the output on pages with lazy loading.
Rank #3
Handle consent dialogs and overlays
Cookie banners, newsletter prompts and chat launchers can obscure content. In a self-managed browser, dismiss them only when doing so matches your capture purpose. If you need repeatable clean images across many sites, a hosted capture service can automate this cleanup.
Keep layout deterministic
- Set a known viewport and device scale factor.
- Use a stable URL and wait for the content that matters.
- Disable or await animations when they change geometry.
- Use a consistent locale, timezone and authentication state when the page varies by user.
- Save a failure screenshot or page HTML separately when diagnosing a broken capture.
Troubleshooting
The image stops at the viewport
Check that the call is Playwright’s page.screenshot and that fullPage: true is present. A Bun.WebView view.screenshot() call is documented as viewport-only.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →The screenshot is blank or partly rendered
Navigation may have completed before the application rendered its content. Wait for a meaningful selector, inspect console and page errors, and confirm that required resources are reachable from the browser environment.
Images or sections are missing
Lazy loading, blocked third-party resources or content that appears only after interaction are common causes. Wait for the relevant elements, perform the required interaction before capture, and check whether the page requires authentication or a specific viewport.
The page never reaches network idle
Analytics, WebSockets and polling can keep connections open. Use domcontentloaded followed by a targeted selector wait, or use a bounded delay as a last resort.
Rank #4
- Brand: Wiley
- Set of 2 Volumes
- A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers
WebView behaves differently across machines
That is expected risk for an experimental API with different platform backends. macOS uses WKWebView; Linux and Windows depend on an installed Chromium-family browser exposed through CDP. Pin your runtime and browser environment in CI and recheck behavior after upgrades.
Free tools Windows power users keep installed
One-click scans. No signup required.
Performance, size and operating cost
Full-page images are taller and usually larger than viewport images. Memory use rises with document height, viewport width, device scale factor and image format. Capture only the scope you need, use a lower device scale factor for ordinary documentation, and write bytes directly when you do not need an in-memory copy. Browser startup is often the largest fixed cost in batch jobs, so reuse a browser process while creating and closing pages per URL.
Self-hosted Playwright gives you control over browser state and scheduling but requires browser installation, updates and resource limits. Bun.WebView avoids Playwright’s full-page option and is best reserved for viewport captures unless you implement and maintain your own stitching system.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Or skip the browser setup
ScreenshotNeo provides a hosted screenshot API for Bun projects. It accepts one GET request and returns PNG, JPEG, WebP or PDF. Before capture it can accept cookie and consent banners and remove more than 60 known consent platforms, newsletter popups and chat widgets; each cleanup step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and response headers identify the page verdict and whether the request was billed.
For a full-page capture, use the API’s URL and full-page options documented at https://screenshotneo.com/docs/. This cURL example targets the same demonstration URL:
Best Value
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp
Python
import requests
r = requests.get(
"https://api.screenshotneo.com/v1/shot",
params={"access_key": "YOUR_API_KEY", "url": "https://example.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://example.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`HTTP ${res.status}`);
await Bun.write('shot.webp', Buffer.from(await res.arrayBuffer()));
ScreenshotNeo also supports element capture, dark mode, device presets and custom viewports, retina scale, PDF paper and page controls, HTML/CSS input, custom JavaScript and CSS, clicks, selector waits, delays, network-idle waits, request and resource blocking, headers, cookies, user agents, authorization, timezone, geolocation, transparent backgrounds, resizing, configurable caching, signed image links, asynchronous webhooks, bulk capture of up to 100 URLs per call, a usage API and an OpenAPI specification. Its parameter names are compatible with those used by other screenshot APIs, which can simplify migration. An MCP server exposes take_screenshot, get_page_info and capture_pdf to Claude, Cursor and other MCP clients.
The Free plan includes 1,000 shots per month with no card. Paid plans start at $5 for 3,000 shots; every feature is included on every plan, and yearly billing gives two months free. Sign up for the free ScreenshotNeo plan to get 1,000 screenshots a month without a card.
FAQ
Does fullPage change the browser viewport?
No. It changes the screenshot scope to the page’s full scrollable document; the viewport settings still control layout and responsive behavior.
Can a full-page screenshot be a PDF?
Playwright’s call above creates an image. Use a PDF-specific browser or hosted API option when the deliverable must be a PDF rather than a raster image.
Recommended Free Tools
Is Bun.WebView production-stable?
Bun documents WebView as experimental. Treat behavior as release-sensitive and validate the exact Bun and browser versions used in development and automation.
The Bottom Line
For a documented full-page screenshot in Bun, use Playwright and pass fullPage: true. Use Bun.WebView’s screenshot() for viewport captures, not as a documented full-page API.
Quick Recap
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.

