October 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 PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

Puppeteer CreatePageOptions: Page Creation Settings Explained

Puppeteer CreatePageOptions selects tab or window creation, with optional window bounds and a shared background flag. Viewport and user-agent settings belong elsewhere.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

CreatePageOptions controls how Puppeteer creates a page: as a tab or as a window, with optional window bounds and a shared optional background property. Pass it to BrowserContext.newPage(). It does not set the page’s viewport or user agent; configure those separately.

What CreatePageOptions controls

The Puppeteer API reference labeled version 25.10.0 defines CreatePageOptions as a union of two creation modes, intersected with an optional background property. In TypeScript, its documented shape is:

export type CreatePageOptions = (
  | {
      type?: 'tab';
    }
  | {
      type: 'window';
      windowBounds?: WindowBounds;
    }
) & {
  background?: boolean;
};

In practical terms, omit type or set it to 'tab' for the tab branch. To select the window branch, set type: 'window'; that branch also permits windowBounds. Either branch permits background. The type reference does not explain the operational effect of background or establish platform-specific behavior for window placement, so avoid relying on assumptions about either without checking documentation for your installed version. See the CreatePageOptions reference.

Branch Fields What the type establishes
Tab type?: 'tab' type may be omitted or explicitly set to 'tab'.
Window type: 'window'; optional windowBounds?: WindowBounds type is required for this branch. The type points to WindowBounds but does not, by itself, describe supported placement behavior.
Shared background?: boolean The property is permitted with either branch; the reference excerpt does not explain its effect.

Where to pass the options

Call BrowserContext.newPage(options?). Puppeteer describes this method as creating a new page in that browser context; it resolves to a Page. The method reference is labeled version 25.12.0, whereas the type reference above is labeled 25.10.0. Check the API reference matching your installed Puppeteer package when version-specific behavior matters.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const page = await context.newPage({ type: 'tab' });
await page.goto('https://example.com');

Because type is optional in the tab branch, this is also valid:

const page = await context.newPage();

And the window branch can be selected like this:

const page = await context.newPage({
  type: 'window',
  windowBounds: { /* values defined by WindowBounds */ },
});

The last example shows where the bounds belong, not a complete bounds object: use the WindowBounds definition in the documentation corresponding to your package rather than guessing its fields. See BrowserContext.newPage().

Rank #2
Sale
HTML and CSS: Design and Build Websites
  • HTML CSS Design and Build Web Sites
  • Comes with secure packaging
  • It can be a gift option

A new page is not a new isolated context

A BrowserContext represents a user context and provides a storage-isolation boundary, including for cookies and localStorage. A page created with context.newPage() belongs to that context. Creating another page in the same context is not the same as creating a separate user context. Puppeteer also documents that a page opened through window.open remains in its parent page’s context. See the BrowserContext reference.

Create an isolated context when storage separation matters

Use browser.createBrowserContext() to create a separate context, then create the page inside it. Closing that context closes its pages. The default context cannot be closed.

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.
const context = await browser.createBrowserContext();
try {
  const page = await context.newPage({ type: 'tab' });
  await page.goto('https://example.com');
  // Work with the page...
} finally {
  await context.close();
}

This illustrates the documented API relationship; adapt it to how your application obtains and manages browser. See Browser.createBrowserContext().

Viewport and user agent belong to other APIs

CreatePageOptions has no viewport dimensions or user-agent field. Set those on the returned Page using methods such as setViewport and setUserAgent, or use Puppeteer’s device emulation API to apply device-style user-agent and viewport settings. The Page reference is labeled version 25.12.0.

Rank #4
Sale
Web Design with HTML, CSS, JavaScript and jQuery Set
  • 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
const page = await context.newPage();
await page.setViewport({ width: 1280, height: 800 });
await page.setUserAgent('your user-agent string');
await page.goto('https://example.com');

For responsive or mobile emulation, configure the viewport before navigation. Puppeteer notes that changing viewport properties can resize a page and, when mobile or touch properties change, may reload it.

Connection-wide viewport defaults are different again

ConnectOptions.defaultViewport configures a viewport for each page at the connection level; its reference documents a default of 800 by 600. This is not a CreatePageOptions field. See ConnectOptions.

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

Common mistakes and fixes

  • Putting viewport or user-agent settings in the creation object: create the page, then use the relevant Page methods, or set a connection-level default viewport where appropriate.
  • Expecting a new page to have separate cookies or localStorage: pages belong to their browser context. Create a separate context when you need a separate storage boundary.
  • Passing a window-only field without selecting the window branch: use type: 'window' when supplying windowBounds.
  • Guessing the fields or platform behavior of windowBounds: consult the matching version’s WindowBounds type and documentation; the creation-options signature alone does not establish platform guarantees.
  • Assuming background has a particular effect: the type permits it, but the cited type reference does not define its operational behavior.
  • Mixing documentation versions: the type reference cited here is labeled 25.10.0, while several related API references are labeled 25.12.0. Verify the references for the package version actually installed.

Or skip the browser setup

If your goal is to retrieve a site screenshot rather than control a Puppeteer page, ScreenshotNeo offers a one-call API. It can capture PNG, JPEG, WebP, or PDF, but it is not a substitute for Puppeteer when you need to programmatically interact with a live page.

cURL:

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)
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}`);

See the ScreenshotNeo API documentation for request options. Before capture, it can accept cookie or consent banners and remove more than 60 known consent platforms, newsletter popups, and chat widgets; each of those steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers identify the page verdict and whether the request was billed. An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents. The free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots. Every feature is on every plan.

Sign up for 1,000 free screenshots a month, with no card required.

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.

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

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.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

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.